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!

Database Performance Sidebar Panel Now on APM Database Query Performance & Service ...

We’ve streamlined the troubleshooting experience for database-related service issues by adding a database ...

IM Landing Page Filter - Now Available

We’ve added the capability for you to filter across the summary details on the main Infrastructure Monitoring ...

Dynamic Links from Alerts to IM Navigators - New in Observability Cloud

Splunk continues to improve the troubleshooting experience in Observability Cloud with this latest enhancement ...