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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...