Splunk Search

How to get rangemap to change the color of bars based on evaluated heap percentage used?

iatwal
Path Finder

how do I change the colors of my bar chart to red, yellow, and green? Here is my query:

index=xyxy env=PROD profile=blah heap_used=* total_heap_size=* | stats last(heap_used) AS heap_used, last(total_heap_size) AS total_avail by host | convert num(heap_used), num(total_avail) | eval heap_perc = tostring(round((heap_used/total_avail)*100,2)) + "%" | convert num(heap_perc) | table host heap_perc | rangemap field=heap_perc green=0-45 yellow=45-60 red=60-100

My XML for the chart:

("red":0xFF0000,"yellow":0xFFFF00,"green":0x00FF00)
0 Karma

somesoni2
Revered Legend

Use this query

index=xyxy env=PROD profile=blah heap_used=* total_heap_size=* | stats last(heap_used) AS heap_used, last(total_heap_size) AS total_avail by host | convert num(heap_used), num(total_avail) | eval heap_perc = tostring(round((heap_used/total_avail)*100,2)) + "%" | convert num(heap_perc) | table host heap_perc | eval green=if(heap_perc>0 AND heap_perc<=45,heap_perc,0) | eval yellow=if(heap_perc>45 AND heap_perc<=60,heap_perc,0) | eval red=if(heap_perc>60 AND heap_perc<=100,heap_perc,0) | table host green yellow red
0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...