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!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...