<?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: Exponential Smoothing Implementation in Splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Exponential-Smoothing-Implementation-in-Splunk/m-p/76201#M19279</link>
    <description>&lt;P&gt;To do a cumulative total in a new field, take a look at the function eventstats.&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.1/SearchReference/Eventstats"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.1/SearchReference/Eventstats&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;and maybe too at the function predict that may already do what you want.&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.1/SearchReference/Predict"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.1/SearchReference/Predict&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Jan 2013 03:18:43 GMT</pubDate>
    <dc:creator>yannK</dc:creator>
    <dc:date>2013-01-03T03:18:43Z</dc:date>
    <item>
      <title>Exponential Smoothing Implementation in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exponential-Smoothing-Implementation-in-Splunk/m-p/76200#M19278</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am planning to implement exponential smoothing in Splunk based on below formula where &lt;BR /&gt;
s1 is the forecasted value. At time t=0, it is equal to first event. For time=t, it is calculated based on below formula. I can hard code value for "alpha".&lt;/P&gt;

&lt;P&gt;s1=x0&lt;BR /&gt;
s{t}=[alpha * x{t-1}] + [(1-alpha)s{t-1}], t&amp;gt;1 &lt;/P&gt;

&lt;P&gt;For time=t, it is referring to previously calculated forecast value (s{t-1}) and previous event value (x{t-1}) so not sure how this can be achieved using Splunk.&lt;BR /&gt;
Say the log data is like below and "total" is the field which needs to be used(x{t}) to calcuate forecasted value(s{t}). I know there will be a field named "total" created which contains all the values but is there a way I can refer to say first value in field "total" like total&lt;A href="https://community.splunk.com/as%20in%20arrays"&gt;0&lt;/A&gt; which will be equal to 4, total[1] which will be equal to 6?&lt;/P&gt;

&lt;P&gt;1/2/13 2:30:00.000 PM total=4 &lt;BR /&gt;
1/2/13 2:31:00.000 PM total=6&lt;BR /&gt;
1/2/13 2:32:00.000 PM total=8&lt;BR /&gt;
1/2/13 2:33:00.000 PM total=10&lt;/P&gt;

&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jan 2013 22:59:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exponential-Smoothing-Implementation-in-Splunk/m-p/76200#M19278</guid>
      <dc:creator>samsplunkd</dc:creator>
      <dc:date>2013-01-02T22:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Exponential Smoothing Implementation in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exponential-Smoothing-Implementation-in-Splunk/m-p/76201#M19279</link>
      <description>&lt;P&gt;To do a cumulative total in a new field, take a look at the function eventstats.&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.1/SearchReference/Eventstats"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.1/SearchReference/Eventstats&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;and maybe too at the function predict that may already do what you want.&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.1/SearchReference/Predict"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.1/SearchReference/Predict&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2013 03:18:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exponential-Smoothing-Implementation-in-Splunk/m-p/76201#M19279</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2013-01-03T03:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Exponential Smoothing Implementation in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exponential-Smoothing-Implementation-in-Splunk/m-p/76202#M19280</link>
      <description>&lt;P&gt;Thanks for the reply But my requirement is little different. This formula expects values from previous calculated results so I would like to know if there is a way I can refer to field values separately like arrays as specified in my question above.&lt;/P&gt;

&lt;P&gt;s{t}=[alpha * x{t-1}] + [(1-alpha)s{t-1}], t&amp;gt;1&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2013 08:05:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exponential-Smoothing-Implementation-in-Splunk/m-p/76202#M19280</guid>
      <dc:creator>samsplunkd</dc:creator>
      <dc:date>2013-01-03T08:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Exponential Smoothing Implementation in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exponential-Smoothing-Implementation-in-Splunk/m-p/76203#M19281</link>
      <description>&lt;P&gt;The trick here is to make all the data required for the calculation in the current event.&lt;/P&gt;

&lt;P&gt;Looking at the formula, it only relies on the previous value of x and the previous value of s.&lt;/P&gt;

&lt;P&gt;You can pull the previous value of a field into the current event like this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | streamstats window=1 current=f total as prev_total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;so now you have access to x{t} and x{t-1} in the event. ( total and prev_total fields respectively)&lt;/P&gt;

&lt;P&gt;You'll also need to pre-populat the 1st valid value of s, then you can use the above method to 'stream' the previous value of s into the current event to calculate s{t}&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2013 11:11:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exponential-Smoothing-Implementation-in-Splunk/m-p/76203#M19281</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2013-01-03T11:11:20Z</dc:date>
    </item>
  </channel>
</rss>

