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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...