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!

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!

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

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...