Dashboards & Visualizations

Single valued dashboard not showing colours

shiva_kolachala
Engager

Hi,

Below is my dashboard xml. But I am not getting the colours. Actually my value is 18 but the single value is only showing me the elevated but im not able to see the colours. Please help.

<?xml version='1.0' encoding='utf-8'?>
<dashboard>
  <label>Business-Dashboard</label>
  <row>
    <single>
      <searchName>AddBankAccountWeb</searchName>
      <searchString>sourcetype="webcentrl_prod_clms.logs" api_time != 0 business_process="AddBankAccountWeb" earliest=-4h | stats sum(api_time) as time by txnId |stats count as mycount | rangemap field=mycount low=100-200 elevated=0-100 default=red</searchString>
    <title>AddBankAccountWeb</title>
    </single>
  </row>
</dashboard>
Tags (3)
1 Solution

joshd
Builder

Add the option:

<option name="classField">range</option>

So it now looks like this:

<?xml version='1.0' encoding='utf-8'?>
<dashboard>
  <label>Business-Dashboard</label>
  <row>
    <single>
      <searchName>AddBankAccountWeb</searchName>
      <searchString>sourcetype="webcentrl_prod_clms.logs" api_time != 0 business_process="AddBankAccountWeb" earliest=-4h | stats sum(api_time) as time by txnId |stats count as mycount | rangemap field=mycount low=100-200 elevated=0-100 default=red</searchString>
    <title>AddBankAccountWeb</title>
    <option name="classField">range</option>
    </single>
  </row>
</dashboard>

The color mappings are controlled by the classField option as described here:

http://docs.splunk.com/Documentation/Splunk/latest/Developer/AddASingleButton

Also I'm not sure why you have default=red in your search string... this wont specify a color, this specifies the default range which can be "low", "elevated" and "severe". And note that typically the "elevated" range is higher than "low" so you may wish to change your values in your search string.

View solution in original post

joshd
Builder

Add the option:

<option name="classField">range</option>

So it now looks like this:

<?xml version='1.0' encoding='utf-8'?>
<dashboard>
  <label>Business-Dashboard</label>
  <row>
    <single>
      <searchName>AddBankAccountWeb</searchName>
      <searchString>sourcetype="webcentrl_prod_clms.logs" api_time != 0 business_process="AddBankAccountWeb" earliest=-4h | stats sum(api_time) as time by txnId |stats count as mycount | rangemap field=mycount low=100-200 elevated=0-100 default=red</searchString>
    <title>AddBankAccountWeb</title>
    <option name="classField">range</option>
    </single>
  </row>
</dashboard>

The color mappings are controlled by the classField option as described here:

http://docs.splunk.com/Documentation/Splunk/latest/Developer/AddASingleButton

Also I'm not sure why you have default=red in your search string... this wont specify a color, this specifies the default range which can be "low", "elevated" and "severe". And note that typically the "elevated" range is higher than "low" so you may wish to change your values in your search string.

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 ...