Dashboards & Visualizations

How to apply different colors to a specific ranges?

ASISH_9
Engager

I have a dashboard named Variance report. If the variancehours is between 1-10 then it should be shown in red, and if the variance hours is in between 10-20, then it should be green, and so on. How should I do that?

0 Karma

whistl034
Explorer

Well, there are two answers. One for splunk up to 6.5.2, which is the now deprecated classField option. For example:

<code>
      <single>
        <title>LT Rate</title>
        <search base="perf2data">
          <query>stats sum(TOTAL) as TOTAL, sum(LT) as LT | eval TX=round(100 * LT / TOTAL, 4) |  fields TX | rangemap field=TX low=0-0.0499 elevated=0.0500-0.2499 default=severe | eval TX=tostring(TX) + "%"</query>
        </search>
        <option name="classField">range</option>
        <option name="drilldown">none</option>
      </single>
</code>

The rangemap command adds the range variable set to low, elevated or severe based on the value in TX, and classField says to use the range field to define the color of the single value text (green, yellow, red).

I actually came here looking for the answer for v6.5.2 and later, because I need to update my dashboards before they break. I'll try to come back and update if I find an answer.

0 Karma

sundareshr
Legend
0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In November, the Splunk Threat Research Team had one release of new security content via the Enterprise ...

Index This | Divide 100 by half. What do you get?

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

Stay Connected: Your Guide to December Tech Talks, Office Hours, and Webinars!

❄️ Celebrate the season with our December lineup of Community Office Hours, Tech Talks, and Webinars! ...