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!

Database Performance Sidebar Panel Now on APM Database Query Performance & Service ...

We’ve streamlined the troubleshooting experience for database-related service issues by adding a database ...

IM Landing Page Filter - Now Available

We’ve added the capability for you to filter across the summary details on the main Infrastructure Monitoring ...

Dynamic Links from Alerts to IM Navigators - New in Observability Cloud

Splunk continues to improve the troubleshooting experience in Observability Cloud with this latest enhancement ...