How To Hide And Display Panels Using Dropdown Option In Splunk Dashboard

How To Hide And Display Panels Using Dropdown Option In Splunk Dashboard

Hello everyone…!!

Like our previous blog posts today we have come with a new magic tricks of Splunk which you have never think before and never heard before….
Have you ever thought of hiding and displaying panels using any input options in Splunk Dashboard ????
Today we will show you how to hide and display panels using dropdown option in Splunk Dashboard. For that you have to create a dashboard.


We have create a dashboard called Drilldown Dashboard. First row there is a one panel called Method Info and in the second row there is another panel called Sourcetype Info.

To hide and display panels using dropdown option in Splunk Dashboard you have to follow the below steps.

Step 1:

You can find Edit option on the top right corner of the dashboard. Click on Edit.

Step 2:

After that you can see the Add Input option . Click on Add Input and then click on Dropdown button.

Step 3:

Now you have to edit the dropdown option. For editing dropdown option you can follow How to Add Dropdown Input option to Splunk Dashboard.

In this way one dropdown option will be created.

Step 4:

After that have to modify the Source Code of the dashboard. You can find the Source option on top left corner of the dashboard. Click on Source.

Step 5:

Now modify the Source Code.

You have to add a change tag inside the input tag. Inside change tag we have written two condition tag.

In the first condition tag we have written label=”Method” which label we have taken from choice tag. For label=”Method” we have set a token called method_token and unset a token called sourcetype_token. In the second condition tag we have written label=”Sourcetype” which label we have taken from choice tag. For label=”Sourcetype” we have unset a token called method_token and set a token called sourcetype_token.

After that we have made the two row dependent upon two token ( method_token and sourcetype_token ) using depends option.

You can use the depends option inside the panel tag also. If there are more than one panel in one row you have to use the depends option inside the panel tag.

Step 6:

See we have now got a cool dashboard…..

If you click on Method then it will show the Method Info panel and if you click on Sourcetype it will show the Sourcetype Info panel. The same process you can follow for any other input options such as radio,multiselect,checkbox etc. in Splunk Dashboard.

You can also download the source code of this sample dashboard by clicking the below button.

SourceCode

Hope this has helped you in achieving the below requirement without fail !!
How To Hide And Display Panels Using Dropdown Option In Splunk Dashboard

Happy Splunking !!

Advertisements

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.