Splunk Search

Use different Regex in one search

tgdvopab
Path Finder

Hello

I have a dashboard with a radio-button input. Depending on which value is selected, I want to use a different regex to extract some fields.
Example:

base search | if STATUS==$token_radiobutton$,regex1,regex2 | table extracted fields from regex

How can I solve this problem?

Thanks a lot

0 Karma

ryandg
Communicator

It might be messy but you could create another input that loads based on the radio button that sets its variable to the REGEX that you would want to run, then, you pass that input's variable into the regex pipe.

For example

base search | if STATUS==$token_radiobutton$,regex1,regex2 | table extracted fields from regex

Set the input's token value to the field STATUS

Then on the dashboard

base search | regex $STATUS_TOK$ |

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...