Splunk Dev

I want to add color to a field in the table depeding on the count which is in other field in the same table.

krrish0930
New Member

I have got the count of accounts ex: |stats count by accountId | table count, health

I need to update health with red or green color depending on the count. if count is > 50 health should be given green color if not it should be red.

Tags (1)
0 Karma
1 Solution

abhijit_mhatre
Path Finder

You can add color to field by modifying the count column of your dashboard. You cannot add colors to results of query/alert/report. If you want to add, just go to count column of dashboard & click on brush icon present next to it. After clicking on it, you can add color ranges according to your required values.

View solution in original post

0 Karma

abhijit_mhatre
Path Finder

You can add color to health field depending upon the count field values. Try using if condition & mention range for count values in health class & mentioning style=background:red(any color) inside in application.js

0 Karma

abhijit_mhatre
Path Finder

You can add color to field by modifying the count column of your dashboard. You cannot add colors to results of query/alert/report. If you want to add, just go to count column of dashboard & click on brush icon present next to it. After clicking on it, you can add color ranges according to your required values.

0 Karma

niketn
Legend

Can you add some sample values for health and count fields? Your stats query seems to restrict the fields to count and accountId. Is health field going to be something static otherwise?

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

krrish0930
New Member

Health field is empty, i need to give it red or green color depending on the value of count. I tried to add application.js and css files it partially worked for me, i was able to add color but it was adding color to the count field but not the health. Is there any way where we can add color to the empty field without writing application.js and css files?

0 Karma

abhijit_mhatre
Path Finder

You can add color to health field depending upon the count field values. Try using if condition & mention range for count values in health class & mentioning style=background:red(any color) inside in application.js

0 Karma

abhijit_mhatre
Path Finder

You can add color to field by modifying the count column of your dashboard. You cannot add colors to results of query/alert/report. If you want to add, just go to count column of dashboard & click on brush icon present next to it. After clicking on it, you can add color ranges according to your required values.

0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...