Splunk Search

How to use token in <scale> tag?

mxh7777
Path Finder

Hi,

I have a dashboard with table and some columns with colorPalette and scale

I'd like to set dynamically the range of the scale for the colorPalette using a text input

I did that but not working

<input type="text" token="myValue" searchWhenChanged="true">
<label>Value Scale</label>
</input>

...

...

<format type="color" field="transaction/arbitrage_v2.0">
<colorPalette type="list">[#FFFFFF,#D41F1F]</colorPalette>
<scale type="threshold">$myValue$</scale>
</format>

but myValue is not interpreted

Is it possible to solve ?

 

Thanks in advance

Labels (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

You can certainly use tokens almost anywhere in a dashboard, including inside embedded CSS and other formatting places - but not ALL.

HOWEVER, for some odd reason it does NOT appear to work in the <scale> definition of a threshold colorPalette.

Don't worry though, you can still achieve it this way, but using an expression type.

<format type="color" field="myValue">
  <colorPalette type="expression">if(value>$sc$, "#FFFFFF", "#D41F1F")</colorPalette>
</format>

You can also use case statements and have a bunch of case statements where you can define different colours.

Note also that you can use tokens in place of the fixed colour definitions. I often use this to load a colour schema from a settings file into tokens and then I can change all the colour scheme of a dashboard just by changing the settings (CSV) file.

 

0 Karma

yuanliu
SplunkTrust
SplunkTrust

I believe that tokens are used for queries, not other elements in dashboard.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...