Dashboards & Visualizations

How to show or hide panel in the dashboard based on multiple dropdown tokens with as-trick

sandeepkumar53
New Member

DropdownA DropdownB DropdownC DropdownD

I have single panel and it should change the search based on the above 4 dropdowns which is using unique searches.

Ex: when I select DropdownA, dashboard panel should execute index=A

  when I select DropdownB , dashboard panel should execute index=B 
Tags (3)
0 Karma

gcusello
Esteemed Legend

Hi @sandeepkumar53,
the easiest solution, if it's acceptable for you, it's using a Radio button in addition to the for dropdown to choose the dropdown to use.

otherwise, you should find a default value for each dropdown that you're sure that isn't present (eg "XXXXXXXXXXXXXXXXXX") in this way you'll have a search like this

(index=A field1=$D1$) OR (index=B field2=$D2$) OR (index=C field3=$D3$) OR (index=D field4=$D4$)
| stats count

So by default you'll have this situation

(index=A field1=XXXXXXXXXXXXXXXXXX) OR (index=B field2=XXXXXXXXXXXXXXXXXX) OR (index=C field3=XXXXXXXXXXXXXXXXXX) OR (index=D field4=XXXXXXXXXXXXXXXXXX)
| stats count

that hasn't any result, but when you choose a value for one dropdown you'll have results because you'll use a real value.
But in this way you could use more than one dropdown at the same time.

Ciao.
Giuseppe

0 Karma
Get Updates on the Splunk Community!

Platform Newsletter Highlights | March 2023

 March 2023 | Check out the latest and greatestIntroducing Splunk Edge Processor, simplified data ...

Enterprise Security Content Updates (ESCU) - New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 3 releases of new content via the Enterprise ...

Thought Leaders are Validating Your Hard Work and Training Rigor

As a Splunk enthusiast and member of the Splunk Community, you are one of thousands who recognize the value of ...