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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...