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!

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...