Dashboards & Visualizations

How to color a date column based on some condition?

anooshac
Communicator

Hi All,

i have some table which have 2 columns, in that one column consists of date.
I want to color the date column such that if the date is today or yesterday the color should be green, and if the date is older that yesterday it should be red. Anyone has idea how to achieve this?
This is the query im using.


index="abc"
sourcetype="xyz"| stats latest(_time) as last_ingestion_time by group
| eval last_ingestion_time=strftime(last_ingestion_time, "%Y-%m-%d %H:%M:%S")
| sort - last_ingestion_time| head 10

Labels (4)
Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Essentially, you could make the field a multi-value field with the colour you want to be used and then hide the extra value with CSS - there have been many answers on this, for example https://community.splunk.com/t5/Dashboards-Visualizations/Highlight-Table-cell-without-Javascript/m-...

Get Updates on the Splunk Community!

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

 Prepare to elevate your security operations with the powerful upgrade to Splunk Enterprise Security 8.x! This ...

Get Early Access to AI Playbook Authoring: Apply for the Alpha Private Preview ...

Passionate about security automation? Apply now to our AI Playbook Authoring Alpha private preview ...

Reduce and Transform Your Firewall Data with Splunk Data Management

Managing high-volume firewall data has always been a challenge. Noisy events and verbose traffic logs often ...