Splunk Search

Conditional cell format without JS?

anonuser
Explorer

Hi, 

I would like to color the cells from a column table depending on their time value

is it possible to be done without JavaScript? Only with CSS and HTML?

For example:

For cells with values lower than  00:05:00 it should be green

For cells between values 00:05:00 and 00:15:00 it should be orange

For cells higher than 00:15:00 it should be red 

 

Labels (2)

anonuser
Explorer

Thanks @niketn-deceased but I tried another way and it worked fine!

<colorPalette type="expression">case (value =="-", "", value &gt; "00:15:00","#D3828C", value &lt;= "00:05:00" ,"#C8E8C6", value &gt; "00:05:00" and value &lt;= "00:15:00","#F2B094"</colorPalette>

0 Karma

@anonuser you will have to adopt the concepts from the following answer and change as per your needs. As far as you are able to use SPL to create a new field for applying color as per Time (same way you have defined in your question), you will need to use the new field for color SLA and use eval to suffix with a delimiter to the required field where you want color applied. Next you split the values by delimiter and then apply color using expressions colorPalette and finally use CSS override to hide the field value for color SLA that you have created.
https://community.splunk.com/t5/Dashboards-Visualizations/How-to-change-font-color-based-on-a-condit...

Please try out and confirm!

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
Get Updates on the Splunk Community!

NEW! Log Views in Splunk Observability Dashboards Gives Context From a Single Page

Today, Splunk Observability releases log views, a new feature for users to add their logs data from Splunk Log ...

Last Chance to Submit Your Paper For BSides Splunk - Deadline is August 12th!

Hello everyone! Don't wait to submit - The deadline is August 12th! We have truly missed the community so ...

Ready, Set, SOAR: How Utility Apps Can Up Level Your Playbooks!

 WATCH NOW Powering your capabilities has never been so easy with ready-made Splunk® SOAR Utility Apps. Parse ...