Splunk Search

how to display week by week data with different colors

AshChakor
Path Finder

I want to display counts by weeks . but current week's  count in "green", last weeks counts in "Orange" and counts older than two weeks in "Red". 

Labels (1)
0 Karma
1 Solution

to4kawa
Ultra Champion
| tstats count where index=_internal by _time span=1d prestats=t
| timechart span=1d count
| eval week=case(_time < relative_time(now(),"-2w"),"twoWeeksAgo", _time < relative_time(now(),"-1w"),"lastWeekAgo",true(),"Current")
| eval weekday=strftime(_time,"%A") | chart sum(count) as count  by weekday week

https://docs.splunk.com/Documentation/Splunk/8.1.1/Viz/ChartConfigurationReference#General_chart_pro...

To change the color, please refer to this page.

View solution in original post

to4kawa
Ultra Champion
| tstats count where index=_internal by _time span=1d prestats=t
| timechart span=1d count
| eval week=case(_time < relative_time(now(),"-2w"),"twoWeeksAgo", _time < relative_time(now(),"-1w"),"lastWeekAgo",true(),"Current")
| eval weekday=strftime(_time,"%A") | chart sum(count) as count  by weekday week

https://docs.splunk.com/Documentation/Splunk/8.1.1/Viz/ChartConfigurationReference#General_chart_pro...

To change the color, please refer to this page.

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 ...