<?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: How to search the count and average count of events per hour? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-and-average-count-of-events-per-hour/m-p/174381#M50029</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;As per this question &lt;A href="http://answers.splunk.com/answers/90569/event-count-per-user-per-hour.html"&gt;http://answers.splunk.com/answers/90569/event-count-per-user-per-hour.html&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=your_sourcetype earliest=-48h latest=-24h | bucket _time span=1h | stats count by _time | sort - count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will count the events per hour between 48 hours ago to 24 hours ago...   (change this as you see fit or remove earliest and latest)&lt;/P&gt;

&lt;P&gt;If you want to average all of those results, you would add the &lt;CODE&gt;stats avg(count)&lt;/CODE&gt; at the end of the search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=your_sourcetype earliest=-48h latest=-24h | bucket _time span=1h | stats count by _time | stats avg(count)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will average out the number of events per hour...&lt;/P&gt;

&lt;P&gt;If you have a specific event you are looking for, that would go at the beginning:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=your_sourcetype earliest=-48h latest=-24h   some_thing_that_I'm_trying_to_match    | bucket _time span=1h | stats count by _time | sort - count

sourcetype=your_sourcetype earliest=-48h latest=-24h   some_thing_that_I'm_trying_to_match    | bucket _time span=1h | stats count by _time | stats avg(count)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 14 Aug 2015 11:32:47 GMT</pubDate>
    <dc:creator>lloydd518</dc:creator>
    <dc:date>2015-08-14T11:32:47Z</dc:date>
    <item>
      <title>How to search the count and average count of events per hour?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-and-average-count-of-events-per-hour/m-p/174380#M50028</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;Please can you provide a search for getting the number of events per hour and average count per hour?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2015 10:25:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-and-average-count-of-events-per-hour/m-p/174380#M50028</guid>
      <dc:creator>shellnight</dc:creator>
      <dc:date>2015-08-14T10:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the count and average count of events per hour?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-and-average-count-of-events-per-hour/m-p/174381#M50029</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;As per this question &lt;A href="http://answers.splunk.com/answers/90569/event-count-per-user-per-hour.html"&gt;http://answers.splunk.com/answers/90569/event-count-per-user-per-hour.html&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=your_sourcetype earliest=-48h latest=-24h | bucket _time span=1h | stats count by _time | sort - count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will count the events per hour between 48 hours ago to 24 hours ago...   (change this as you see fit or remove earliest and latest)&lt;/P&gt;

&lt;P&gt;If you want to average all of those results, you would add the &lt;CODE&gt;stats avg(count)&lt;/CODE&gt; at the end of the search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=your_sourcetype earliest=-48h latest=-24h | bucket _time span=1h | stats count by _time | stats avg(count)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will average out the number of events per hour...&lt;/P&gt;

&lt;P&gt;If you have a specific event you are looking for, that would go at the beginning:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=your_sourcetype earliest=-48h latest=-24h   some_thing_that_I'm_trying_to_match    | bucket _time span=1h | stats count by _time | sort - count

sourcetype=your_sourcetype earliest=-48h latest=-24h   some_thing_that_I'm_trying_to_match    | bucket _time span=1h | stats count by _time | stats avg(count)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Aug 2015 11:32:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-and-average-count-of-events-per-hour/m-p/174381#M50029</guid>
      <dc:creator>lloydd518</dc:creator>
      <dc:date>2015-08-14T11:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the count and average count of events per hour?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-and-average-count-of-events-per-hour/m-p/174382#M50030</link>
      <description>&lt;P&gt;THANK YOU VERY MUCH !!!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2015 12:26:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-count-and-average-count-of-events-per-hour/m-p/174382#M50030</guid>
      <dc:creator>shellnight</dc:creator>
      <dc:date>2015-08-14T12:26:07Z</dc:date>
    </item>
  </channel>
</rss>

