How can I match 2 lines of the same file that have a random number of other lines between them?
1111 Start Sub Transaction. New Id 1115
other lines here
1115 Transaction End. No Funds Available
I need to match them on ID = 1115 and extract the result (in this case "No Funds Available").
Thank you.
Like this:
... | rex "^(?<firstWord>\w+).*(?<lastWord>\w+)$" | eval ID=if(isnumber(lastWord), lastWord, firstWord) | stats list(_raw) by ID