LogViewPlus Support

RegEx parser for XML style log file

https://www.logviewplus.com/forum/Topic2287.aspx

By Sebastian - 5 Nov 2024

Hello,
I'm trying to create a RegEx parser for a XML style logfile. 
The regex itself would work, but I have to set the single line regex flag for it.

/^<(?<Direction>(Send|Recv)) TYPE="(?<Function>.+?)" UTC="(?<date>.+?)" ID="(?<ID>.+?)"(?:\s*\/>|>(?<Message>.*?)<\/\1>)$/sgim


You can see an example here: https://regex101.com/r/n2xyCK/1

Is there a way to do this withing the logview parser?
By LogViewPlus Support - 4 Dec 2024

Hi Sebastian,

Apologies for the slow reply.  Our forum software incorrectly flagged this message as spam.  Unfortunately, this can happen sometimes when users pick usernames which are too generic.  You may want to update your username by clicking on the 'Your Profile' link above (it is next to your user name) and then selecting 'Edit Account'.

Regarding the parsing issue above, it is going to be difficult to parse this file using the XML or Regex parsers.  Instead, I would recommend using the Pattern Parser.

I am able to get a good parse with:
<%s{Direction} TYPE="%c" UTC="%d" ID="%S{ID}"%n

This will give you something like:


Hope that helps,

Toby