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 July Tech Talks, Office Hours, and Webinars!

What are Community Office Hours?Community Office Hours is an interactive 60-minute Zoom series where ...

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...