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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...