LogViewPlus Support

Lines with Different Pattern

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

By Email User - 8 Nov 2018

Hello,

I am trying to make use of LogViewPlus by defining a custom expression for Pattern Parsing.
Right now I have this pattern: 

[%d][%S{File}:%s{Function}:%s{Line}]%m%n

But not all of my lines have this pattern, some of them have only

[%d]%m%n

How can I setup the pattern to give me empty strings of File, Function and Line columns when they are missing.
Right now the parser stop loading any lines when the first line that doesn't matches the pattern is encountered.

Thanks! Regards
By LogViewPlus Support - 8 Nov 2018

Hi,

Have you tried using a multi-pattern?  This is described here:
https://www.logviewplus.com/docs/pattern_parser.html

It is also a good idea to specify the date format explicitly. Especially if the date formats differ.  Please see:
https://www.logviewplus.com/docs/date_specifier.html

Thanks,

Toby

By Email User - 8 Nov 2018


Hello Toby,

Thanks for the tip!

But what if I have an arbitrary number of spaces at the begining of the line, before [%d], the is any format like regex \s* ?
By LogViewPlus Support - 8 Nov 2018

I don't think the PatternParser will be able to handle that scenario.  You may be better off using the BasicParser.