Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Grok filter is not working when id has dashes

I have a sample input like below.

[2022-01-06 19:51:42,143] [http-nio-8080-exec-7] DEBUG  [50a4f8740c30b9ca,c1b11682-1eeb-4538-b7f6-d0fb261b3e1d]

I implemented a grok filter to validate the text.

\[%{TIMESTAMP_ISO8601:timestamp}\] \[(?<threadname>[^\]]+)\] %{LOGLEVEL:logLevel}  \[%{WORD:traceId},%{WORD:correlationId}\]

When I validate it, it says there are no matches.
But If I remove – in correlation id, that filter is working fine. Is there any modification to do to the filter to accept – in the correlation id?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Try this.

\[%{TIMESTAMP_ISO8601:timestamp}\] \[%{DATA:threadName}\] %{LOGLEVEL:logLevel}  \[%{DATA:traceId},%{DATA:correlationId}\]
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading