Splunk Search

How to append a query based on a variable chosen from a drop-down form?

sumyatnoepwint
New Member

I need to append the query based on the defined variable.

  1. I declared a variable for the drop-down using token="TEST"
  2. I used $TEST in the query for a panel. What I want to do is like the following; if $TEST == "E1" query1 else query 2

Please let me know whether it is possible in XML or in a search.

0 Karma

frobinson_splun
Splunk Employee
Splunk Employee

Hi @sumyatnoepwint,
I believe the "condition" element should help you handle various input selections. See
http://docs.splunk.com/Documentation/Splunk/6.5.0/Viz/PanelreferenceforSimplifiedXML#condition_.28in...

You can also check out the form input examples in the Dashboard Examples App
https://splunkbase.splunk.com/app/1603/

Hope this helps!

0 Karma
Get Updates on the Splunk Community!

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 ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...