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
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...