RegEx parser for XML style log file


Author
Message
Sebastian
Sebastian
New Member (2 reputation)New Member (2 reputation)New Member (2 reputation)New Member (2 reputation)New Member (2 reputation)New Member (2 reputation)New Member (2 reputation)New Member (2 reputation)New Member (2 reputation)
Group: Forum Members
Posts: 1, Visits: 11
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?
LogViewPlus Support
LogViewPlus Support
Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)
Group: Moderators
Posts: 1.2K, Visits: 4.3K
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

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Login

Explore
Messages
Mentions
Search