By keli - 25 May 2022
Hi,
I was wondering if it would be possible to add an option to %S - or perhaps have another string specifier - that would act non-greedy, i.e. match the first occurrence of the following separator, not the last?
i.e. I have the following line, say
2022-05-12T19:21:25.065+0200; DEBUG; hostname123; P4216/T31; [Component]; Conversation state changed: ACTIVE -> ACTIVE. Call leg state changed: CallLegStateChange[ACTIVE->ACTIVE for callLeg: CallLeg [2c8a32f9066d396540b7024414c86fe8@1.2.3.4 -- D-638b5c9f-b60e-4d55-9544-cdbc51b5cd06] state: ActiveState@4b9f5055, status=UnknownStatus@2fb72ab2, additionalData=null];
And I'd like to parse this with: %d{yyyy-MM-ddT%H:mm:ss.fffzzzz}; %p; %c; %t; [%S{Component}]; %S{Action}: %m%n
Where I'd want the Action field to be "Conversation state changed"
I can't really seem to make this work with a Pattern Parser. Probably could either do a custom parser, or a regex parser, but I was thinking this feature may be a useful addition to the simple pattern parser as well.
Thanks, Zoltan
|
By LogViewPlus Support - 25 May 2022
Hi Zoltan,
The example provided seems to work as you would expect:

It is not clear what you are trying to achieve, but I suspect the problem you are having may be related to the other log entries in the file. LogViewPlus does not support parsers with optional arguments, but you may want to experiment with multi-patterns. These allow you to apply multiple parsers to the same log file.
Hope that helps,
Toby
|
By keli - 26 May 2022
Oh, burn I was hoping I can come up with a simple example, but haven't tested it myself.  You are perfectly right, and my problem was that I was already using a multi-parser, and a different pattern line matched in my real-life scenario, rather than which I was expecting to match.
Sorry for the confusion created.
|
By LogViewPlus Support - 26 May 2022
No worries Zoltan - glad that helped. :-)
|
|