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!

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...

[Live Demo] Watch SOC transformation in action with the reimagined Splunk Enterprise ...

Overwhelmed SOC? Splunk ES Has Your Back Tool sprawl, alert fatigue, and endless context switching are making ...

What’s New & Next in Splunk SOAR

Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us on ...