How to skip log entries that cannot be parsed


Author
Message
Ace
Ace
New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)
Group: Forum Members
Posts: 2, Visits: 7
My IDE outputs some logs that do not match my formatted logs.
This causes LogViewPlus to not be able to open the file.
Is there a way to simply have the application skip entries it cannot parse?

thanks,
David
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 David,

Short of writing a custom parser, there is no way to skip log entries. 

I would expect LogViewPlus to handle an unknown log entry by appending it to the previous log entry.  In this way, the data can still be found with a text search.  I would certainly expect LogViewPlus to be able to open the log file.  Are you using the latest version of LogViewPlus?  What happens when the log file fails to open?

If you want to parse the alternate format, you might want to consider parsing with a multi-pattern.

Hope that helps,

Toby
Edited 2 Years Ago by LogViewPlus Support
Ace
Ace
New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)New Member (7 reputation)
Group: Forum Members
Posts: 2, Visits: 7
Thanks Toby...

Here is the part of the log that is giving me trouble:
The log starts with these series of characters, then newline, then my logs start...


How do I write a pattern for this?

The pattern for my logs is:
%d{yyyy-MM-dd %H:mm:ss}    %S{Type}    %S{Source}    %S{Msg}%n

Now I want to add a new pattern for:


I tried regex for exactly 10 chars - I want to ignore any line with exactly 10 chars.
/^..........$/gm

But if I check the "regex" i would think my original pattern would stop working.

Regardless, it tells me "minimum of two elements must be found"

any approach you would take?

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
The text:


Cannot be used to represent a log entry because no timestamp can be determined.

However, I don't think this text is causing the problem.  LogViewPlus should be appending this text to the next (or first) log entry.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Login

Explore
Messages
Mentions
Search