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!

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had 3 releases of new security content via the Enterprise Security ...

Archived Metrics Now Available for APAC and EMEA realms

We’re excited to announce the launch of Archived Metrics in Splunk Infrastructure Monitoring for our customers ...