I’m using a custom Grok rule to extract a value from the log message using regex (Graylog version 2.2.3). When there is more than one match, the extractor is always gives the last matched string as result output. Is there any way I can get the first matched string as output?
For example:
[8/1/17 14:53:23:457 GMT] 00000192 TestServer A Some message contain 1 as integer.
I want to extract the A, so I’m using the following regex in the extractor logic: (\s{1,2}[EWA123]{1}\s) unfortunately this regex also matches 1. I’m looking for a way to get the first matching result not the last matching result.