<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: average count by day in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58808#M14430</link>
    <description>&lt;P&gt;this is the one I needed thank much&lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2013 20:51:38 GMT</pubDate>
    <dc:creator>hartfoml</dc:creator>
    <dc:date>2013-03-12T20:51:38Z</dc:date>
    <item>
      <title>average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58799#M14421</link>
      <description>&lt;P&gt;I have a search looking for the events I want to look at.  Then i want to have the average of the events per day.&lt;/P&gt;

&lt;P&gt;I only want the average per day number so that I can alert if it is over or under the average&lt;/P&gt;

&lt;P&gt;I have like this &lt;CODE&gt;search event=foo | stats avg(count) by date_day&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;What am i doing wrong??&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 14:02:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58799#M14421</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-03-12T14:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58800#M14422</link>
      <description>&lt;P&gt;First of all, the internal field is date_mday. Also, using streamstats will update the average as it goes along. For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="access_combined_wcookie" status=503 | stats count as daycount by date_mday | streamstats avg(daycount)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;output is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;date_mday   daycount         avg(daycount)
    15          2                2.000000
    16          5                3.500000
    18          2                3.000000
    19          2                2.750000
    20          4                3.000000
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Mar 2013 14:50:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58800#M14422</guid>
      <dc:creator>richcollier</dc:creator>
      <dc:date>2013-03-12T14:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58801#M14423</link>
      <description>&lt;P&gt;Hi Rich,  Thanks so much for your comments.  I found this on the Answers site but I did not know what I was looking at when I got the resultes.  I got two collumbs of numbers. one columb was day_mday and the other was avg(count). the mday collumb had changeing numbers and the avg(count) columb had no numbers.  Lets see if i can put this a better way for more help.  I have events happening every day for 30 days.  I want to know only one number (Average Count per day).&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 16:22:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58801#M14423</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-03-12T16:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58802#M14424</link>
      <description>&lt;P&gt;This might be as simple as total number of events devided by 30 or there could be more complecated math that would through out the low and high, discount any zero values, etc.  I was hoping there was a way to handle this in splunk???&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 16:23:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58802#M14424</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-03-12T16:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58803#M14425</link>
      <description>&lt;P&gt;I think that you want to calculate the daily count over a period of time, and &lt;EM&gt;then&lt;/EM&gt; average it. This is two steps:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search event=foo
| bucket _time span=1d
| stats count by _time
| stats avg(count) as AverageCountPerDay
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I did not rely on &lt;CODE&gt;date_mday&lt;/CODE&gt; - what if your time range was larger than a month? What if your data doesn't have the &lt;CODE&gt;date_mday&lt;/CODE&gt; field? Instead, I used the &lt;CODE&gt;bucket&lt;/CODE&gt; command to set the internal time &lt;CODE&gt;_time&lt;/CODE&gt; to a one-day span, and counted by that. So, I guess that made it 3 steps. &lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 16:52:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58803#M14425</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-03-12T16:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58804#M14426</link>
      <description>&lt;P&gt;sorry, there was an error in my answer, i fixed it&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 16:58:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58804#M14426</guid>
      <dc:creator>richcollier</dc:creator>
      <dc:date>2013-03-12T16:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58805#M14427</link>
      <description>&lt;P&gt;One of the problems with this approach is defining a proper "over" or "under" the average. +/- 2 times the average? +/- 2 standard deviations? This approach of using avg and stddev is inaccurate if the count of the events in your data do not form a "normal distribution" (bell curve). &lt;/P&gt;

&lt;P&gt;If ultimately your goal is to use statistics to learn "normal" behavior, and know when that behavior (count per day) is very different, then a more proper statistical modeling and anomaly detection approach is needed. See Anomaly Detective app: &lt;A href="http://splunk-base.splunk.com/apps/68765/prelert-anomaly-detective"&gt;http://splunk-base.splunk.com/apps/68765/prelert-anomaly-detective&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 17:09:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58805#M14427</guid>
      <dc:creator>richcollier</dc:creator>
      <dc:date>2013-03-12T17:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58806#M14428</link>
      <description>&lt;P&gt;good point on date_mday&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 17:09:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58806#M14428</guid>
      <dc:creator>richcollier</dc:creator>
      <dc:date>2013-03-12T17:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58807#M14429</link>
      <description>&lt;P&gt;BTW, date_mday isn't an internal field - it is extracted from events that have a human-readable timestamp. So it isn't always available.&lt;/P&gt;

&lt;P&gt;Also, why &lt;CODE&gt;streamstats&lt;/CODE&gt;? It is a pretty resource-intensive command. If you want to see the individual days and the average, try &lt;CODE&gt;eventstats&lt;/CODE&gt; instead. It will look different, though.&lt;/P&gt;

&lt;P&gt;I like your solution that shows both the individual days and the average...&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 17:09:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58807#M14429</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-03-12T17:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58808#M14430</link>
      <description>&lt;P&gt;this is the one I needed thank much&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 20:51:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58808#M14430</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2013-03-12T20:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58809#M14431</link>
      <description>&lt;P&gt;&lt;CODE&gt;date_mday&lt;/CODE&gt; worked like a charm. Where can we find all such "internal" fields?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2014 22:23:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58809#M14431</guid>
      <dc:creator>l0pher</dc:creator>
      <dc:date>2014-07-15T22:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58810#M14432</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;

&lt;P&gt;Is there a way of showing the percentage increase or decrease from the commands "stats count as daycount by date_mday | streamstats avg(daycount)" so you can see on a visualization if the events for that day are above or below average? thanks in advance.&lt;/P&gt;

&lt;P&gt;Colin&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2017 13:39:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58810#M14432</guid>
      <dc:creator>colinmchugo</dc:creator>
      <dc:date>2017-04-05T13:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58811#M14433</link>
      <description>&lt;P&gt;This is an old thread with an accepted answer so you're unlikely to get a response.  Please post a new question.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2017 15:03:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58811#M14433</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-04-05T15:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58812#M14434</link>
      <description>&lt;P&gt;thanks richgalloway &lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 10:45:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58812#M14434</guid>
      <dc:creator>colinmchugo</dc:creator>
      <dc:date>2017-05-24T10:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58813#M14435</link>
      <description>&lt;P&gt;I need the count and average of my field to be displayed for every 1 minute. Any suggestions please?&lt;/P&gt;

&lt;P&gt;Note: It is not a numeric field&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 07:44:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58813#M14435</guid>
      <dc:creator>akarivaratharaj</dc:creator>
      <dc:date>2018-06-28T07:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58814#M14436</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
Is these a way to get "hourly" AVG of 30 days ?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Roy&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 21:08:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58814#M14436</guid>
      <dc:creator>royswapan</dc:creator>
      <dc:date>2019-08-05T21:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: average count by day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58815#M14437</link>
      <description>&lt;P&gt;@royswapan This is an old thread with an accepted answer so you're unlikely to get a response. Please post a new question.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 22:30:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/average-count-by-day/m-p/58815#M14437</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-08-05T22:30:55Z</dc:date>
    </item>
  </channel>
</rss>

