Splunk Search

how do I get daily average over a month for all the pages I receive

vadud3
Path Finder

I receive about say between 10 to 20 alerts per day. All these pages shows as an event in my splunk. How do I find out what is average number of events I received daily over a month

so I tried like this

  • | timechart span=30d count | eval average=count/30

does that look right?

so lets say I receive 10 alerts on day1, 9 alerts on day2 and 8 alerts on day3 .. and so on for a month. I like splunk to tell me something like 9 as the average number of alerts I receive daily over a month.

Thanks

Tags (1)

jnichols914
Explorer

This is a bit old, but you can do this:

<your search here> | Stats avg(yourfield) by date_month,date_mday | sort date_mday
0 Karma

gkanapathy
Splunk Employee
Splunk Employee

Probably easier to just use:

 ... | timechart span=1d count as dailycount | timechart span=1mon mean(dailycount)

which will work if you're dealing with partial months. (e.g., if today is the 22nd of the month and you run a report that goes over the last 60 days).

jlovik
Explorer

Is there a way to remove any day where the specific event count is 0? I would like to remove any day where the logs did not import. The days with events 0 are throwing off my averages. 

0 Karma

Simeon
Splunk Employee
Splunk Employee

The best way to get statistics for this type of duration is to utilize a summary index:

http://www.splunk.com/base/Documentation/latest/Knowledge/Usesummaryindexing

That would allow you to do complete reporting across all the data over the whole month, on a daily basis.

Alternatively:

You could enable indexing of the $SPLUNK_HOME/var/log/splunk/scheduler.log file. This file logs when an alert is sent from the scheduler. You would need to find out the exact alert you are triggering. You can then report the total count over 30 days and use your eval statement as described.

vadud3
Path Finder

these alerts are not splunk related. for splunk they are just events.

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...