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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...