Dashboards & Visualizations

SingleValue for Ration: Best Option for Coloring

triest
Communicator

I'm working on a dashboard for metrics and one of the metrics is a ratio; I would like to color the ration red, yellow, or green based on percentage values.

The "easy" solution is just to display a percentage and we can easily use the interface to set threshold values for the colors. I would really like to display a ration, however.

If I use a ratio, I can calculate the percent, use rangemap to set the follow, and then classField to se the color. The problem with this approach is classField is set as deprecated. I would assume if it has been deprecated, they have thought through the use cases and have a way to display one field (the ratio) but use another (the percentage) for coloring, but I haven't figured it out yet.

0 Karma

cmerriman
Super Champion

try adding this eval (though you may need to swap the signs/order) to the end of your query:

|eval range=case(percentage>xx,"severe",percentage>xx,"elevated",percentage>xx,"low")

these colors relate to those values.
http://docs.splunk.com/Documentation/Splunk/latest/Viz/SingleValueFormatting#Migration_for_rangemap_...

and add <option name="field">ratio</option> to your options

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!

Painting a Clearer Picture: Creating Cross-Domain Visibility with AI Canvas

    Thursday, June 25, 2026  |  11AM PDT / 2PM EDT  Duration: 1 Hour (Includes live Q&A) Register to ...

Analytics Workspace deprecation

As of Splunk Cloud Platform 10.4.2604 and Splunk Enterprise 10.4, Analytics Workspace is now deprecated. ...

Splunk Developer Day Recap: Building, Publishing, and Growing on the Splunk Platform

Splunk Developer Day brought the Splunk developer community together for a practical look at what it means to ...