Dashboards & Visualizations

change the color of a single value panel based on time

sravani27
Path Finder

Hi guys, I am trying to change the color of a single value panel based on the timestamp.
Eg: if the count is > 5 from 12 am - 8 am - the panel should be green, and if the count is > 5 from 8 am - 6 pm - the panel should be red.
I am trying to dynamically change the colors based on the timerange
Please help.

Tags (1)

niketn
Legend

@sravani27 please add more details to your use case. What happens for 6:00 PM to midnight? Also what is count is <5 what happens during all the timings?

What is the query to fetch count? Could you please add some sample data and SPL? Please mock/anonymize any sensitive information. I your count some kind of count for current hour and based on hour of the day you want to color the count?

In order for the community to assist you better please provide further details as requested. This seems to be a use case for Simple XML JS extension where you would color based on current hour and count returned by the query. Please confirm!

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

Goldbeed
Engager

I couldent figure out a way to edit the colors in the search but you can in the dashboards. I don't think you can in search.

Search:
| sort - time | eval VioletTimes>1.5sec = if (time>1.5,time ,0) | eval RedTimes>1sec = if(time <=1.5 AND time >1,time ,0) | eval OrangeTimes>750ms = if(time <=1 AND time >0.75,time ,0) | eval .YellowTimes>500ms = if(time <=0.75 AND time >0.5,time ,0) | eval .NormalTimes<500ms = if(time <=0.5, time , 0) | fields - time

XML edit on dashboard
{"VioletTimes>1.5sec":0x8B2252, "RedTimes>1sec":0xFF0000, "OrangeTimes>750ms":0xFFA500, ".YellowTimes>500ms":0xFFFF00, ".NormalTimes<500ms":0x73A550}

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...