Splunk Search

How can I customize my chart to show labels instead of number values and to be color-coded?

duffeysplunk
Path Finder

I have a service which we need to monitor discrete states. I only get events if the state changes. I can map these states (e.g. error, init, pending, standby, hot) to numerical values and then graph them on a timechart. With the filldown command I can also maintain the current state to produce a graph that shows the current state at any given time.

What I would like to do next is map those numerical values and provide some content. Ideally it would be to replace the y-axis so that instead of -1 through 3 it would display the states as text. Other options that would also work would be to color each column a different color based on the state (for example, make the column chart turn red when it is in an error state), or provide a legend that would make it easier to read. Basically I want someone to be able to look at the timechart and say at a given time what the state was without wondering what a 0, 1, 2 or 3 means.

This is what I have thus far:
alt text

Also, if it gets me the desired effect I could also break it down so RCS, Realtime, and isps do not appear on the same panel but ideally would like to have that functionality as well.

Any ideas that might help on this.

Splunk 6.6.1

0 Karma
1 Solution

DalJeanis
Legend

Run anywhere sample that produces something like you are asking for...

| makeresults 
| eval status="error init hot pending standby whatever"
| makemv status 
| mvexpand status
| streamstats count as recno
| eval _time=60*floor(_time/60) + 60*recno
| eval mycount = 10 
| table _time mycount status
| eval range= case(status="error","red", status="init","purple", status="hot","green", status="pending","gray", status="standby","blue", true(),"black")
| chart sum(mycount) as count by _time status

The height of the bar could be manipulated however you want it.

View solution in original post

0 Karma

DalJeanis
Legend

Run anywhere sample that produces something like you are asking for...

| makeresults 
| eval status="error init hot pending standby whatever"
| makemv status 
| mvexpand status
| streamstats count as recno
| eval _time=60*floor(_time/60) + 60*recno
| eval mycount = 10 
| table _time mycount status
| eval range= case(status="error","red", status="init","purple", status="hot","green", status="pending","gray", status="standby","blue", true(),"black")
| chart sum(mycount) as count by _time status

The height of the bar could be manipulated however you want it.

0 Karma

duffeysplunk
Path Finder

I was able to use something very close to this, but also had to use multiseries to get it display exactly how I wanted. Thanks

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...