Splunk Search

weekend and weekday calculations

vinitpathri
Path Finder

i have data on daily basis.

Date Number day of the week
2019-05-02 52.55 thursday
2019-05-03 327.57 friday
2019-05-04 279.97 saturday
2019-05-05 266.87 sunday
2019-05-06 374.41 monday
2019-05-07 301.24 tuesday
2019-05-08 373.11 wednesday

i want to write 1 query which shows me the data as average for weekdays and average for weekends separately
say in the above case the output should look like
weekend : 273.42
weekday : 285.77

thanks in advance

0 Karma

Sukisen1981
Champion
 <your  current output>|rename "day of the week" as day|eval day=case(day="Wednesday" OR day="Thursday" OR day="Monday" OR day="Tuesday" OR day="Friday","weekday",day="Saturday" OR day="Sunday","weekend")|stats avg(Number) by day

Take care of the string cases and spellings

0 Karma

Sukisen1981
Champion
<your  current output>|rename "day of the week" as day|eval day=case(day="Wednesday" OR day="Thursday" OR day="Monday" OR day="Tuesday" OR day="Friday","weekday",day="Saturday" OR day="Sunday","weekend")|stats avg(Number) by day

Take care of the string cases and spellings

0 Karma
Get Updates on the Splunk Community!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...