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

niketn
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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...