Features
Support
Purchase
Documentation
Download
Login
Register
Login
Register
Home
»
LogViewPlus Support
»
Features & Suggestions
»
Non-greedy string specifier in the Pattern parser?
Non-greedy string specifier in the Pattern parser?
Post Reply
Like
0
Non-greedy string specifier in the Pattern parser?
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Zoltan Kelemen
Zoltan Kelemen
posted Last Year
ANSWER
Topic Details
Share Topic
Group: Forum Members
Posts: 21,
Visits: 97
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
Reply
Like
0
LogViewPlus Support
LogViewPlus Support
posted Last Year
ANSWER
Post Details
Share Post
Group: Moderators
Posts: 985,
Visits: 3.2K
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
Reply
Like
0
Zoltan Kelemen
Zoltan Kelemen
posted Last Year
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 21,
Visits: 97
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.
Reply
Like
0
LogViewPlus Support
LogViewPlus Support
posted Last Year
ANSWER
Post Details
Share Post
Group: Moderators
Posts: 985,
Visits: 3.2K
No worries Zoltan - glad that helped. :-)
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
0
Similar Topics
Post Quoted Reply
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search