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!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...