<?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: Generate Rolling Summation in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Generate-Rolling-Summation/m-p/84297#M21496</link>
    <description>&lt;P&gt;Here's your search: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | bucket _time span=1min | streamstats sum(Concurrency) as rollingSum window=60 | sort - rollingSum
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The bucket will normalize all the data to minute boundaries. Essentially it just throws away the seconds and subseconds values. &lt;/P&gt;

&lt;P&gt;Then the streamstats command just keeps a rolling sum of the past 60 rows (including the current row). &lt;/P&gt;

&lt;P&gt;Then just sort descending on rollingSum and that's your busiest 60 minute period. &lt;/P&gt;

&lt;P&gt;some references: &lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Streamstats" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/Streamstats&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Bucket" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/Bucket&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Nov 2010 08:14:13 GMT</pubDate>
    <dc:creator>sideview</dc:creator>
    <dc:date>2010-11-19T08:14:13Z</dc:date>
    <item>
      <title>Generate Rolling Summation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-Rolling-Summation/m-p/84296#M21495</link>
      <description>&lt;P&gt;I have a set of data that has one event for ever second, with a field for the number of simultaneous phone calls going on each second. (&lt;A href="http://answers.splunk.com/questions/7615/report-on-busiest-hour" rel="nofollow"&gt;Here&lt;/A&gt; is more background.) E.g.:
&lt;BR /&gt;
&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Concurrency
&lt;BR /&gt;10/25/2010 00:00:00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0
&lt;BR /&gt;10/25/2010 00:00:01&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0
&lt;BR /&gt;10/25/2010 00:00:02&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0
&lt;BR /&gt;10/25/2010 00:00:03&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0
&lt;BR /&gt;....
&lt;BR /&gt;10/25/2010 13:01:01&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7
&lt;BR /&gt;10/25/2010 13:01:02&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8
&lt;BR /&gt;10/25/2010 13:01:03&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/P&gt;

&lt;P&gt;What I want to get out of the data is what is the 60 minute period of time with the highest sum(Concurrency). Looking simply, I could do a &lt;CODE&gt;| stats sum(Concurrency) as HourlySum by date_hour | stats max(HourlySum)&lt;/CODE&gt;. The only problem there is that it cuts the window directly along 00:00-59:59 minute periods. If the busiest period of time is 13:22:00-14:21:59, it wouldn't be properly represented. &lt;/P&gt;

&lt;P&gt;Is there any way to do a rolling average, so I could get the data I need out of it? &lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2010 04:41:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-Rolling-Summation/m-p/84296#M21495</guid>
      <dc:creator>David</dc:creator>
      <dc:date>2010-11-05T04:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Rolling Summation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-Rolling-Summation/m-p/84297#M21496</link>
      <description>&lt;P&gt;Here's your search: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | bucket _time span=1min | streamstats sum(Concurrency) as rollingSum window=60 | sort - rollingSum
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The bucket will normalize all the data to minute boundaries. Essentially it just throws away the seconds and subseconds values. &lt;/P&gt;

&lt;P&gt;Then the streamstats command just keeps a rolling sum of the past 60 rows (including the current row). &lt;/P&gt;

&lt;P&gt;Then just sort descending on rollingSum and that's your busiest 60 minute period. &lt;/P&gt;

&lt;P&gt;some references: &lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Streamstats" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/Streamstats&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Bucket" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/Bucket&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2010 08:14:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-Rolling-Summation/m-p/84297#M21496</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2010-11-19T08:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Rolling Summation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Generate-Rolling-Summation/m-p/84298#M21497</link>
      <description>&lt;P&gt;Huzzah! That solved it! Thanks, sir.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2010 01:48:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Generate-Rolling-Summation/m-p/84298#M21497</guid>
      <dc:creator>David</dc:creator>
      <dc:date>2010-11-20T01:48:39Z</dc:date>
    </item>
  </channel>
</rss>

