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!

Observability Unlocked: Kubernetes Monitoring with Splunk Observability Cloud

 Ready to master Kubernetes and cloud monitoring like the pros? Join Splunk’s Growth Engineering team for an ...

Update Your SOAR Apps for Python 3.13: What Community Developers Need to Know

To Community SOAR App Developers - we're reaching out with an important update regarding Python 3.9's ...

October Community Champions: A Shoutout to Our Contributors!

As October comes to a close, we want to take a moment to celebrate the people who make the Splunk Community ...