Splunk Search

Fire Dynamic Search Queries based on Tokens

raja21
Explorer

I have various Inputs and i want to execute different query based of different token input value.

Eg. I have 2 different tokens user_name and user_profile.
I am displaying the results in a Statistical table.

Now my search query is:
index="main" u_name=$user_name$ AND u_profile=$user_profile$

However i want to make the search query as:
if($user_name$) #If $user_name$ token is set
index="main" u_name=$user_name$

if($user_profile$) #If $user_profile$ token is set
index="main" u_profile=$user_profile$

Please help me out.

Tags (1)
0 Karma

woodcock
Esteemed Legend

Have 3 panels.: One that depends on $user_profile$, another that depends on $user_name$, and a third that depends on both.

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...