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

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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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