Dashboards & Visualizations

Using a drop-down to populate dashboard panels, how to get the static names as the panel titles and the associated values to populate the searches?

pepper_seattle
Path Finder

Overview
I have a dashboard with multiple panels affected by a drop-down menu. The drop-down menu has static options, so names and associated values that have been manually entered. Need to get the names of the static options (names which appear in the drop-down menu as options) onto the panel titles, but Splunk will place the static values instead when the menu's token is placed in the panel title.

Question
How do I get the names for each static option (not the values) to appear when selected on the affected panels?

Example
Token: tok
Name: Mobile
Value: device="smrtphone" OR device="tblt"

<title>$tok$ Revenue</title> 

Comes out as: device="smrtphone" OR device="tblt" Revenue

0 Karma
1 Solution

jeffland
SplunkTrust
SplunkTrust

In the Simple XML of the dashboard, you need to set another token which contains the label. Should look something like this:

<input type=...>
  <choice>...</choice>
  ...
  <default>...</default>
  <change>
    <set token="token_label">$label$</set>
  </change>

Now you can use $token_label$ in the title of your view, and it should display the label of the currently selected option.

View solution in original post

0 Karma

jeffland
SplunkTrust
SplunkTrust

In the Simple XML of the dashboard, you need to set another token which contains the label. Should look something like this:

<input type=...>
  <choice>...</choice>
  ...
  <default>...</default>
  <change>
    <set token="token_label">$label$</set>
  </change>

Now you can use $token_label$ in the title of your view, and it should display the label of the currently selected option.

0 Karma

dolivasoh
Contributor

This works for me when the token value and label are the same, but of course it does. Would also like to know how to differentiate between the two as I haven't experimented with using the name. I assume it's not possible, The name is simply for aesthetics, I think.

0 Karma

Suryadeep
New Member

can somebody show an example for this?

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