Dashboards & Visualizations

Change single value color based on textual value

DavidHourani
Super Champion

Hello,

I have a single value panel displaying "KO", "WARNING", "OK" and I would like to add colors to it.. By default colors can be added to numbers based on the range but I wish to display the text and change the color based on the text value.

Any idea how I can do this, which option in XML should I modify ?

Regards,
David

Tags (2)
1 Solution

3no
Communicator

Hello David,

You can use range in your search :

| eval range=if(your_field_name==your_field_value, "severe", "low") 

Then in simple XML :

<option name="field">field_name</option>

3no

View solution in original post

3no
Communicator

Hello David,

You can use range in your search :

| eval range=if(your_field_name==your_field_value, "severe", "low") 

Then in simple XML :

<option name="field">field_name</option>

3no

DavidHourani
Super Champion

what are the possible values for range beside severe, low ?

0 Karma

3no
Communicator

also elevated and default

0 Karma

niketn
Legend

@DavidHourani you can choose between

low, guarded, elevated, high, severe or direct color names like green, blue, yellow, orange, red

| eval range=case(your_field_name==your_field_value1, "severe", your_field_name==your_field_value2,"high",your_field_name==your_field_value3,"low",true(),"low")

Read the following documentation, also make sure no-one edits the UI configuration for the Single Value panel: http://docs.splunk.com/Documentation/Splunk/latest/Viz/SingleValueFormatting#Migration_for_rangemap_...

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

adonio
Ultra Champion
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...