<?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 show accumulated sum over bin of time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-accumulated-sum-over-bin-of-time/m-p/370895#M109141</link>
    <description>&lt;P&gt;I got an error saying by using the time_window the input has to be in sorted in time order. Any suggestion to fix this?&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jun 2017 00:51:25 GMT</pubDate>
    <dc:creator>ericyeh1995</dc:creator>
    <dc:date>2017-06-27T00:51:25Z</dc:date>
    <item>
      <title>how to show accumulated sum over bin of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-accumulated-sum-over-bin-of-time/m-p/370893#M109139</link>
      <description>&lt;P&gt;I would like to calculate the accumulated energy used over a period of 15 minutes. The sum has to start around min%15==0 (hh:00, hh:15, hh:30, hh:45). The plot should look similar to a sawtooth plot with accumulated power reset to 0 every 15 minutes. &lt;/P&gt;

&lt;P&gt;Currently, I am able to create an accumulated plot for a specific window:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=pm_energy  | reverse | accum d.Act_power_realtime{} as tot_pow | timechart last(tot_pow) span=20s
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I couldn't get it to reset every 15 minutes. I want my graph to look like this:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3125i4413356D8B02E705/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
Where the data used in the above graph is calculated in a separate program.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 06:36:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-show-accumulated-sum-over-bin-of-time/m-p/370893#M109139</guid>
      <dc:creator>ericyeh1995</dc:creator>
      <dc:date>2017-06-26T06:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to show accumulated sum over bin of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-accumulated-sum-over-bin-of-time/m-p/370894#M109140</link>
      <description>&lt;P&gt;You can use &lt;CODE&gt;streamtstats&lt;/CODE&gt; and the &lt;CODE&gt;time_window&lt;/CODE&gt; option.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/streamstats"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/streamstats&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;host=pm_energy  | streamstats time_window=15m sum(d.Act_power_realtime{}) as tot_pow | timechart last(tot_pow) span=20s&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 12:12:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-show-accumulated-sum-over-bin-of-time/m-p/370894#M109140</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-06-26T12:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to show accumulated sum over bin of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-accumulated-sum-over-bin-of-time/m-p/370895#M109141</link>
      <description>&lt;P&gt;I got an error saying by using the time_window the input has to be in sorted in time order. Any suggestion to fix this?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 00:51:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-show-accumulated-sum-over-bin-of-time/m-p/370895#M109141</guid>
      <dc:creator>ericyeh1995</dc:creator>
      <dc:date>2017-06-27T00:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to show accumulated sum over bin of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-accumulated-sum-over-bin-of-time/m-p/370896#M109142</link>
      <description>&lt;P&gt;Try this - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; host=pm_energy  
| reverse
| rename COMMENT as "Above gets the records in time order"

| rename COMMENT as "Set each 15 minute time period as its own pulse of time" 
| eval timepulse=floor(_time/900) 

| rename COMMENT as "Accumulate power for each pulse" 
| streamstats current=t sum(d.Act_power_realtime{}) as tot_pow by timepulse 

| rename COMMENT as "Drop unneeded data and present results" 
| table _time tot_pow
| timechart last(tot_pow) as tot_pow span=20s
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Notes - You might want to consider whether you want 8:15 exactly to be the beginning of 8:15:00.000-8:29:59.999 or the end of 8:00:00.001-8:15:00.000  &lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 02:05:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-show-accumulated-sum-over-bin-of-time/m-p/370896#M109142</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-06-27T02:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to show accumulated sum over bin of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-accumulated-sum-over-bin-of-time/m-p/370897#M109143</link>
      <description>&lt;P&gt;Thank you! This works great!&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 08:09:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-show-accumulated-sum-over-bin-of-time/m-p/370897#M109143</guid>
      <dc:creator>ericyeh1995</dc:creator>
      <dc:date>2017-06-27T08:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to show accumulated sum over bin of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-show-accumulated-sum-over-bin-of-time/m-p/370898#M109144</link>
      <description>&lt;P&gt;Probably add &lt;CODE&gt;|sort 0 +_time&lt;/CODE&gt; after the initial search filter.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 11:15:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-show-accumulated-sum-over-bin-of-time/m-p/370898#M109144</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-06-27T11:15:21Z</dc:date>
    </item>
  </channel>
</rss>

