Dashboards & Visualizations

How do I display a dropdown input as "Name" instead of "Value"?

sochsenbein
Communicator

Hello,

I added a dropdown input at the top of my dashboard with various time intervals to refresh each chart. Now, on the charts' subtitles, I would like to display that auto-refresh rate. The token for the dropdown input is $AutoRefresh$:

Name:                    Value:
1 minute                1m
5 minutes              5m
10 minutes            10m
15 minutes            15m
30 minutes            30m

In the subtitle I have:
This chart auto refreshes every $AutoRefresh$

This displays, for example, 5m when I would like it to display 5 minutes. Reading the documentation I am not seeing any "additions" to tokens, such as $AutoRefresh.Name$, etc.

Is this possible to do?

0 Karma
1 Solution

renjith_nair
Legend

@sochsenbein,

Add a change event to the dropdown and set the token to "label" .

<form>
  <fieldset submitButton="false">
    <input type="dropdown" token="Autorefresh">
      <label>AutoRefresh</label>
      <choice value="1m">1 Minute</choice>
      <choice value="5m">5 Minutes</choice>
      <change>
        <set token="LabelName">$label$</set>
      </change>
    </input>
  </fieldset>
  <row>
    <html>
      <h3>$LabelName$   :  $Autorefresh$</h3>
    </html>
  </row>
</form>
---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

0 Karma

renjith_nair
Legend

@sochsenbein,

Add a change event to the dropdown and set the token to "label" .

<form>
  <fieldset submitButton="false">
    <input type="dropdown" token="Autorefresh">
      <label>AutoRefresh</label>
      <choice value="1m">1 Minute</choice>
      <choice value="5m">5 Minutes</choice>
      <change>
        <set token="LabelName">$label$</set>
      </change>
    </input>
  </fieldset>
  <row>
    <html>
      <h3>$LabelName$   :  $Autorefresh$</h3>
    </html>
  </row>
</form>
---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

sochsenbein
Communicator

@renjith.nair that works, I appreciate it!

0 Karma
Get Updates on the Splunk Community!

New This Month - Splunk Observability updates and improvements for faster ...

What’s New? This month, we’re delivering several enhancements across Splunk Observability Cloud for faster and ...

What's New in Splunk Cloud Platform 9.3.2411?

Hey Splunky People! We are excited to share the latest updates in Splunk Cloud Platform 9.3.2411. This release ...

Buttercup Games: Further Dashboarding Techniques (Part 6)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...