I would like to store a regex pattern in a variable and use it to extract data. I've seen lots of similar questions but haven't been able to figure this out.
I can do the following
| makeresults count=1 | eval val=4 | rex field=val "(?<dig>\d)"
but I cannot
| makeresults count=1 | eval val=4 | eval ptn="(?<dig>\d)" | rex field=val ptn
Ultimately, I would have regex patterns stored in a CSV file and use lookup to get the correct pattern for a given query. It seems the above would a minimal implementation of this strategy.
... View more