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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...