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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...