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!

Splunk App for Anomaly Detection End of Life Announcment

Q: What is happening to the Splunk App for Anomaly Detection?A: Splunk is officially announcing the ...

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...