Please find the below single Log entry with multiple lines:
>Validation results
Message 1) sucess: true
Message 2) sucess: false
Reason : All is an invalid log event type
Message 3) sucess: true
......
Need rex to fetch only false with reason lines.
Remaining needs to be ignored.
Tried below rex not getting proper results.
|Rex field=_raw "(?ms)(?<result>(.*)(?:true)"|table result
Try this
| rex "(?<result>false[\s\S]*)Message"
| table result
Still it fetches sucess: true
regex101.com disagrees. https://regex101.com/r/deZogv/1
To just get the reason:
| rex "(?ms)sucess: false[^\n]\n(?<field>[^\n]+)"
To get both lines:
| rex "(?ms)(?<field>[^\n]+sucess: false[^\n]+\n[^\n]+)"
Both queries are not returning any reaults
Perhaps if you could share some more realistic log data (anonymised of course) it might help us work out what may be going wrong
Did you try this?