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!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...