Security

complex conditional search

intosplunk
Engager

Hey Splunkers, 
I'm trying to create a conditional search that will run on the same index but will have different search terms according to a variable I have that can have one of three values.
It is supposed to be something like that:
index = my_index
variable = 1/2/3
if variable=1 then run search1
if variable=2 then run search2
if variable=3 then run search3

i tried multiple ways but they didn't work so im trying to get some help here😬

0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @intosplunk ,

let me understand: how do you set variable1/2/3: using a dropdown or based on a condition inside the search?

If based on a dropdown, you can insert the different searches in the dropdown values.

If based on a condition, you should share your searches to understand how to build your complex search.

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @intosplunk ,

let me understand: how do you set variable1/2/3: using a dropdown or based on a condition inside the search?

If based on a dropdown, you can insert the different searches in the dropdown values.

If based on a condition, you should share your searches to understand how to build your complex search.

Ciao.

Giuseppe

intosplunk
Engager

i just tried doing it in a dashboad and insert the different searches in a dropdown values and used the token after a search and it worked. thank you very much.

0 Karma
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...