<?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 How do I get a TRUE average event count per hour grouped by a single field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-TRUE-average-event-count-per-hour-grouped-by-a/m-p/406011#M117372</link>
    <description>&lt;P&gt;I'd like to assess how many events I'm getting per hour for each value of the &lt;CODE&gt;signature&lt;/CODE&gt; field. However, &lt;CODE&gt;stats&lt;/CODE&gt; calculates an average that excludes the hours that don't return any events (i.e., this isn't a true average of events per hour). I know how to accomplish this if I'm using a static time scope - however, I'd really like to leverage this search in a dashboard with a &lt;CODE&gt;timepicker&lt;/CODE&gt;. My search is as follows...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| mvexpand signature 
| bucket _time span=1hour 
| stats count by signature,_time
| stats avg(count) as average by signature
| eval average=round(average,2)
| sort - average
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 24 Jul 2019 20:38:59 GMT</pubDate>
    <dc:creator>RDurica</dc:creator>
    <dc:date>2019-07-24T20:38:59Z</dc:date>
    <item>
      <title>How do I get a TRUE average event count per hour grouped by a single field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-TRUE-average-event-count-per-hour-grouped-by-a/m-p/406011#M117372</link>
      <description>&lt;P&gt;I'd like to assess how many events I'm getting per hour for each value of the &lt;CODE&gt;signature&lt;/CODE&gt; field. However, &lt;CODE&gt;stats&lt;/CODE&gt; calculates an average that excludes the hours that don't return any events (i.e., this isn't a true average of events per hour). I know how to accomplish this if I'm using a static time scope - however, I'd really like to leverage this search in a dashboard with a &lt;CODE&gt;timepicker&lt;/CODE&gt;. My search is as follows...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| mvexpand signature 
| bucket _time span=1hour 
| stats count by signature,_time
| stats avg(count) as average by signature
| eval average=round(average,2)
| sort - average
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Jul 2019 20:38:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-TRUE-average-event-count-per-hour-grouped-by-a/m-p/406011#M117372</guid>
      <dc:creator>RDurica</dc:creator>
      <dc:date>2019-07-24T20:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a TRUE average event count per hour grouped by a single field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-TRUE-average-event-count-per-hour-grouped-by-a/m-p/406012#M117373</link>
      <description>&lt;P&gt;Just switch to &lt;CODE&gt;timechart&lt;/CODE&gt; which fills timeslots with &lt;CODE&gt;0&lt;/CODE&gt; values by default:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | mvexpand signature 
| timechart span=1h limit=0 count BY signature
| untable _time signature count
| stats avg(count) AS average BY signature
| eval average=round(average, 2)
| sort 0 - average
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jul 2019 21:04:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-TRUE-average-event-count-per-hour-grouped-by-a/m-p/406012#M117373</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-26T21:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a TRUE average event count per hour grouped by a single field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-TRUE-average-event-count-per-hour-grouped-by-a/m-p/406013#M117374</link>
      <description>&lt;P&gt;Thank you much woodcock! This did the trick. I wasn't aware of the "untable" command, so thank you for the quick lesson.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 13:34:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-TRUE-average-event-count-per-hour-grouped-by-a/m-p/406013#M117374</guid>
      <dc:creator>RDurica</dc:creator>
      <dc:date>2019-07-31T13:34:24Z</dc:date>
    </item>
  </channel>
</rss>

