Dashboards & Visualizations

How to create a dashboard based on the option selected in dropdown?

vrmandadi
Builder

I am creating a dashboard which gives me CPU usage ,wait time ,idle time etc. In the same dashboard I have added other panels for memory like memory usage , memory free , average memory etc.

I want to have a drop down which has the options CPU and memory .On selecting the CPU only the CPU panels should display and when memory is selected only the memory panels should display.

Thanks in Advance!

0 Karma

siddharthkhatsu
Explorer

You can do it by adding depends=$token$ for panels.
like

<panel depends=$tokenCPU$> CPU PANELS </panel>
<panel depends=$tokenMemory$> MEMORY PANELS </panel>

and set these tokens in the input like

<input type="dropdown" token="type" searchWhenChanged="true"> 
<change>
<condition value="CPU">
    <set token="tokenCPU">$type$</set>
    <unset token="tokenMemory"></unset> 
</condition>
<condition value="MEMEORY">
    <unset token="tokenCPU"></set>
    <set token="tokenMemory">$type$</set>
</condition>
<condition></condition>
</change>
0 Karma

niketnilay
Legend

@vrmandadi if you want to push it a bit you can follow the Splunk blog to create dashboard with tabs for CPU and Memory

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi vrmandadi,
you should see the Splunk Dashboard Examples App ( https://splunkbase.splunk.com/app/1603/ 😞 there's a dashboard example to do something like your need.
In the app is described how to display or hide a panel usinga choice button, but it's the same thing using a dropdown.

Bye.
Giuseppe

vrmandadi
Builder

Thank you for your reply.is there any specific name for that example

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi vrmandadi,
it's Link Switcher.
Anyway, Dashboard Examples is a mandatory app for Splunkers.

Bye.
Giuseppe

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi vrmandadi,
if you're satisfied by this answer, please accept and/or upvote it.

Bye, see next time.
Giuseppe

0 Karma

niyaz006
Path Finder

Link Switcher

0 Karma