Splunk Search

Count by Day of Week

Craig_Ph
Loves-to-Learn Lots

I am on Day 2 with Splunk.

I am trying to get the average number of records by Day of the Week (Mon, Tue, Wed, etc) of the specified timespan.  I can get the total counts by Day of the Week, but I can't seem to get the average number of transactions per Day of the Week.

This gets me the total number of transactions for each day of the week in that timespan:
index=xxxxxxxxxxxxx
| eval day=strftime(_time,"%a")
| stats count by day

How do I get this to average out so that if I have 1000 records for Mondays and I have 4 Mondays in that timespan then I get the value to be 250?

I found this post from 2014, but I can't get that to work:  https://community.splunk.com/t5/Splunk-Search/day-of-the-week-average/m-p/142904

Labels (2)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

try this

index=xxxxxxxx
| bin _time span=1d
| eval day=strftime(_time,"%a")
| stats dc(_time) as days count by day
| eval average_count = count / days
0 Karma
Get Updates on the Splunk Community!

Detecting Brute Force Account Takeover Fraud with Splunk

This article is the second in a three-part series exploring advanced fraud detection techniques using Splunk. ...

Buttercup Games: Further Dashboarding Techniques (Part 9)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Buttercup Games: Further Dashboarding Techniques (Part 8)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...