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!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...