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!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...