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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...