Dashboards & Visualizations

How can I create a drop-down for panels in a dashboard?

adityaanand
Explorer

Hi,

I want to create a drop-down in dashboard for panels.
Suppose I have four panels with different titles.
When a user selects a panel from the drop-down, then that panel should be seen in dashboard.

Regards,
Aditya

0 Karma

khubyarb
Path Finder

You can create the dropdown with the names of the panels. Then you would add this into the XML of each panel:

This will only display the panel when "showPanel", or whatever you name your token, is clicked on. You might want to use checkboxes so that a user can display multiple panels at a time though. Hope that helps

0 Karma

ngatchasandra
Builder

Hi adity,
you can do this in two ways:

This method allows you to control the searches within the tabs such that they do not execute until you click the tab. I have used this technique in apps and it has worked very well for me.

  • Because you want to select a panel , in my view point, do following:

Create X ( X is matching the number of panels you want to create ) repports where each repports have his query .
After do that, create an Dashboard .
Add an dropdown input and set it with only attributs like this:

1) Label : Select_panel
2) Search on Change : Enabled
3) Token : panel
4) Default: "you can select an panel to run by default when you open your dashboard"
5) Go in statics options and add X options like follow example:
Name Value
Panel1 Title1
Panel2 Title2

Panel1 and panel2 are names of my two search panels.

My entire code is:

<form>
   <label>Select_panel</label>
   <fieldset submitButton="false">
     <input type="dropdown" token="panel" searchWhenChanged="true">
       <label>Select_search</label>
       <choice value="Count_by_sourcetype">Panel1</choice>
       <choice value="Count_warning_count_sourcetype">Panel2</choice>
       <default>Count_by_sourcetype</default>
     </input>
   </fieldset>
   <row>
     <panel>
       <title>panel</title>
       <table>
         <title>Count_by_sourcetype</title>
         <search>
           <query>|savedsearch $panel$</query>
         </search>
         <option name="wrap">undefined</option>
         <option name="rowNumbers">undefined</option>
         <option name="drilldown">row</option>
       </table>
     </panel>
   </row>
 </form>

jeffland
SplunkTrust
SplunkTrust

Simple - populate a token from the dropdown and make the panels depend on that token. See here for more info.

0 Karma

splunker12er
Motivator

You may take a look at this app,
https://splunkbase.splunk.com/app/466

provides lot more examples on dropdowns..

also , you can take a look at the xml source file of dashboards with several panels. (s.o.s , etc)

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!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

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 ...