<?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 sessions per hour in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Average-sessions-per-hour/m-p/257754#M77192</link>
    <description>&lt;P&gt;This works! Thank you for the speedy reply, I'm still trying to grasp the complexity of the search language.&lt;/P&gt;</description>
    <pubDate>Sun, 04 Oct 2015 00:53:19 GMT</pubDate>
    <dc:creator>alaking</dc:creator>
    <dc:date>2015-10-04T00:53:19Z</dc:date>
    <item>
      <title>Average sessions per hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-sessions-per-hour/m-p/257752#M77190</link>
      <description>&lt;P&gt;I am trying to calculate the average number of sessions per hour based on "off hours" 5pm to 9 am. I have the time range and events, I just need to do the math. &lt;BR /&gt;
This returns an empty result set:&lt;BR /&gt;
&lt;CODE&gt;Search here &lt;BR /&gt;
| stats count(sessionid) as total2 &lt;BR /&gt;
| stats avg(total2) by date_hour&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This returns a time chart but it's averaging the values of sessionid (which is a numeric field):&lt;BR /&gt;
&lt;CODE&gt;Search here | timechart span=24h per_hour(sessionid) as AvgPerHour&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;and finally, this returns the count per hour as expected but I'm at a loss as to how to average based on this count:&lt;BR /&gt;
&lt;CODE&gt;search here | stats count(sessionid) by date_hour&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Thanks in advance for reading.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2015 05:57:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-sessions-per-hour/m-p/257752#M77190</guid>
      <dc:creator>alaking</dc:creator>
      <dc:date>2015-10-03T05:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: Average sessions per hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-sessions-per-hour/m-p/257753#M77191</link>
      <description>&lt;P&gt;You need to chain 2 &lt;CODE&gt;stats&lt;/CODE&gt; commands like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search here | bucket _time span=1h | stats dc(sessionid) AS sessionIds by _time | stats avg(sessionids)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Run this with a &lt;CODE&gt;timepicker&lt;/CODE&gt; value that spans many hours.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Oct 2015 13:31:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-sessions-per-hour/m-p/257753#M77191</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-10-03T13:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Average sessions per hour</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-sessions-per-hour/m-p/257754#M77192</link>
      <description>&lt;P&gt;This works! Thank you for the speedy reply, I'm still trying to grasp the complexity of the search language.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Oct 2015 00:53:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-sessions-per-hour/m-p/257754#M77192</guid>
      <dc:creator>alaking</dc:creator>
      <dc:date>2015-10-04T00:53:19Z</dc:date>
    </item>
  </channel>
</rss>

