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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...