Parsing multi-line files


Author
Message
Laura
Laura
New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)
Group: Forum Members
Posts: 3, Visits: 8
I've got some testing scripts that output multiple lines that I'm having some issues parsing. The format of the output is:
1
03/05/20 14:11:28

DIG 0.0536 ms ;; Received 66 bytes from x.x.x.x#53(x.x.x.x) in 64 ms ****NSLOOKUP 0.0252 ms Server: ns1
DIG 0.0309 ms ;; Received 66 bytes from x.x.x.x#53(x.x.x.x) in 23 ms ****NSLOOKUP 0.0226 ms Server: ns2
DIG 0.0309 ms ;; Received 66 bytes from x.x.x.x#53(x.x.x.x) in 23 ms ****NSLOOKUP 0.0222 ms Server: ns3
DIG 0.0275 ms ;; Received 66 bytes from x.x.x.x#53(x.x.x.x) in 24 ms ****NSLOOKUP 0.0215 ms Server: ns4

Each test increments the counter by 1 and lists the time the test started.

The basic parser will pull out the sequence number and date and put all 4 lines as the message. The Parser Wizard doesn't like any patterns, regardless of how detailed or basic I make it. [Unable to parse log entry. Error: Including the new line, a minimum of two elements must be found in the conversion pattern.] The PatternParser with multiple arguments comes the closest, but separates the lines so that they're no longer associated with the date or sequence number. I have to include %n in order for them to work, though.
What I'd love is for each test cycle to be a single row, without needing to manipulate either the input or the output.
LogViewPlus Support
LogViewPlus Support
Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.7K
Hi Laura,

LogViewPlus defines a log entry as a timestamp plus a message.  In this case, your 'log entries' are missing a timestamp and therefore cannot be parsed as a log entry.

We have plans to work around this where the message can be parsed independently of the log entry, but unfortunately, this feature will not be ready for several months.

The only solution I can think of at the moment is to write a custom parser, but this approach will require you to generate a 'stub' date for the log entries.  You can find out more about writing custom parsers here:  https://www.logviewplus.com/docs/custom_parsers.html

Hope that helps,

Toby
Laura
Laura
New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)
Group: Forum Members
Posts: 3, Visits: 8
Thanks for the reply. I may give it a shot... or just wait for the update. :
LogViewPlus Support
LogViewPlus Support
Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.7K
I will go ahead and add a +1 to that feature.  I think it would be really powerful, it is just that we have a lot on our road map at the moment.

Thanks for the feedback Laura.  Please let me know if you have any other questions or issues.

Toby
Laura
Laura
New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)New Member (10 reputation)
Group: Forum Members
Posts: 3, Visits: 8
I broke apart my scripts and added the date to each line, then I was able to run the parser wizard twice on each file (for attempts that worked and ones that errored out), then combine the two strings in the Global Parser under Settings, then combine the files, and voila! Exactly what I needed!
LogViewPlus Support
LogViewPlus Support
Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.7K
Glad to hear you got it working Laura.  Thanks for the update!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Login

Explore
Messages
Mentions
Search