I have a use case where i would need to use regex to extract values only if a condition is met.
index=sample
[search index=sample key=my_key
|table msg host]
| rex max_match=0 field=_raw "a\d=\"(?<test>.*?)\""
| eval a = if(len(a)>255 OR isnull(a),"*Regex and if statements need to be here*",a)
| stats values(test) as test by msg host
The aim is to use regex inside the if statement .
The logic is if len(a) or a is null then use regex and populate the value test.
I am looking for the same functionality as match() but instead of bool value I need the matched results.
Is there any way to get this functionality?
... View more