<?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: Chart average event occurrence per hour of the day for the last 30 day in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293643#M88638</link>
    <description>&lt;P&gt;Try something like this and see how it looks if I understood what you were asking. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=security extracted_eventtype=authentication earliest=-30d@d | bucket span=1h _time | stats count by _time, date_hour | stats avg(count) AS hourly_average by date_hour | sort date_hour
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 10 Feb 2017 01:08:29 GMT</pubDate>
    <dc:creator>starcher</dc:creator>
    <dc:date>2017-02-10T01:08:29Z</dc:date>
    <item>
      <title>Chart average event occurrence per hour of the day for the last 30 day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293642#M88637</link>
      <description>&lt;P&gt;I'm trying to get the chart that shows per hour of the day, the average amount of a specific event that occurs per hour per day looking up to 30 days back.&lt;/P&gt;

&lt;P&gt;Currently I have the following query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=security extracted_eventtype=authentication | stats count as hit BY date_hour | chart avg(hit) as "Avg. Auth Attempts" by date_hour
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which gets me the total per hour but doesn't seem to be getting me the actual average.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2017 23:11:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293642#M88637</guid>
      <dc:creator>jpringle03</dc:creator>
      <dc:date>2017-02-09T23:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Chart average event occurrence per hour of the day for the last 30 day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293643#M88638</link>
      <description>&lt;P&gt;Try something like this and see how it looks if I understood what you were asking. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=security extracted_eventtype=authentication earliest=-30d@d | bucket span=1h _time | stats count by _time, date_hour | stats avg(count) AS hourly_average by date_hour | sort date_hour
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Feb 2017 01:08:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293643#M88638</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2017-02-10T01:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Chart average event occurrence per hour of the day for the last 30 day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293644#M88639</link>
      <description>&lt;P&gt;Maybe this will work?&lt;/P&gt;

&lt;P&gt;index=security extracted_eventtype=authentication | timechart span=1h avg(count) AS "whatever" by date_hour&lt;/P&gt;

&lt;P&gt;date_hour doesn't consider your time zone though so use it with caution.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:49:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293644#M88639</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2020-09-29T12:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Chart average event occurrence per hour of the day for the last 30 day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293645#M88640</link>
      <description>&lt;P&gt;First of all, never use the "free" &lt;CODE&gt;date_*&lt;/CODE&gt; fileds; they are pre-TZ-normalization artifacts which means that they are almost always WRONG.  Always calculate your own.  Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=security extracted_eventtype=authentication
| bin _time span=1h
| eval date_hour=strftime(_time, "%H")
| stats count AS hits first(date_hour) AS date_hour BY _time
| stats avg(hits) BY date_hour
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Feb 2017 05:11:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293645#M88640</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-02-10T05:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Chart average event occurrence per hour of the day for the last 30 day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293646#M88641</link>
      <description>&lt;P&gt;This worked! Thanks so much.&lt;/P&gt;

&lt;P&gt;How would I go about rounding those final numbers in each hour? I tried to add a round around the avg but Splunk does not like that at all.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 18:47:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293646#M88641</guid>
      <dc:creator>jpringle03</dc:creator>
      <dc:date>2017-02-10T18:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Chart average event occurrence per hour of the day for the last 30 day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293647#M88642</link>
      <description>&lt;P&gt;Add this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval "avg(hits)" = round('avg(hits)', 2)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Feb 2017 19:13:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293647#M88642</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-02-10T19:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Chart average event occurrence per hour of the day for the last 30 day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293648#M88643</link>
      <description>&lt;P&gt;@woodcock I just stumbled across this post and I really like your solution. Would it be easy to expand upon it and search search back -3h@h to -1h@h and alert if there is a significant increase from -2 hours ago to -1 hour ago? Essentially I'm trying to come up with an easy way to alert on if my IPS events increase during a given period of time.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 21:11:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293648#M88643</guid>
      <dc:creator>ericl42</dc:creator>
      <dc:date>2018-12-18T21:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Chart average event occurrence per hour of the day for the last 30 day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293649#M88644</link>
      <description>&lt;P&gt;yes, just add &lt;CODE&gt;earliest=-3h@h latest=-1h@h&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 22:36:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293649#M88644</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-12-18T22:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Chart average event occurrence per hour of the day for the last 30 day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293650#M88645</link>
      <description>&lt;P&gt;Right, I added that and I see the avg(hits) showing up as I expect it to. The problem I'm running into is how to now look at the first row and see if there is a standard deviation or X increase in logs from line two. (i.e. Row one = 100, Row two = 150, 50% increase = trip an alert). Ideally I'm going to move this to a correlation rule.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 14:39:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/293650#M88645</guid>
      <dc:creator>ericl42</dc:creator>
      <dc:date>2018-12-19T14:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Chart average event occurrence per hour of the day for the last 30 day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/634665#M220491</link>
      <description>&lt;P&gt;Not sure if you are still monitoring these, but I wanted to use this solution and compare the current count against the output of this query in a dashboard panel and its driving me nuts.&amp;nbsp; So if the current hourly count is 5 at 6pm, compare it to the output of the 6PM average from this solution.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 23:25:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-average-event-occurrence-per-hour-of-the-day-for-the-last/m-p/634665#M220491</guid>
      <dc:creator>smahoney</dc:creator>
      <dc:date>2023-03-15T23:25:07Z</dc:date>
    </item>
  </channel>
</rss>

