Dashboards & Visualizations

Hide Visual on Splunk Dashboard

CodingMaestro
Path Finder

So currently I have a dashboard that has a single select dropdown, and a trendline visual on the dashboard. I want a way where that trendline panel/visual is hidden if the option is "*" when it is any other option the panel should be shown. Below is my SPL for the trendline:

<panel>
<title>Total Number of Books Read</title>
<chart>
<search>
<query>| inputlookup BooksRead.csv
| search Books_Category="$bc$"
| table _time Total_Books Total_Books_Read</query>
<earliest>-60m@m</earliest>
<latest>now</latest>
</search>
<option name="charting.chart">line</option>
<option name="charting.drilldown">none</option>
<option name="refresh.display">progressbar</option>
</chart>
</panel>

Any help would be greatly appreciated.

Labels (5)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

In your dropdown change handler, set or unset a token based on the selection. Then you can use the depends attribute on the panel

<panel depends="$makevisibletoken$">

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

In your dropdown change handler, set or unset a token based on the selection. Then you can use the depends attribute on the panel

<panel depends="$makevisibletoken$">

CodingMaestro
Path Finder

Hello @ITWhisperer ,
I am not really sure where i should set and unset my token, if you could help would be great:
<input type="dropdown" token="bc">
<label>Book Category</label>
<choice value="*">(All)</choice>
<default>*</default>
<initialValue>*</initialValue>
<fieldForLabel>Book_Categrories</fieldForLabel>
<fieldForValue>Book_Categrories</fieldForValue>
<search>
<query>| inputlookup Book_Categrories
| stats count by Book_Categrories</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
</input>

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
<input type="dropdown" token="bc">
<label>Book Category</label>
<choice value="*">(All)</choice>
<default>*</default>
<initialValue>*</initialValue>
<fieldForLabel>Book_Categrories</fieldForLabel>
<fieldForValue>Book_Categrories</fieldForValue>
<search>
<query>| inputlookup Book_Categrories
| stats count by Book_Categrories</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<change>
<eval token="makevisibletoken">if($bc$=="*",null(),"true")</eval>
</change>
</input>

CodingMaestro
Path Finder

Perfect, Thank you for your help. Worked like a charm!! 🙂

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...