<?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: Is there a streamstats function that will show a running result of each value in a row being multiplied by the result above? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-streamstats-function-that-will-show-a-running-result/m-p/130982#M35726</link>
    <description>&lt;P&gt;I absolutely will. I marked this answer as correct as it gave me what I was looking for which was a new way to use streamstats.&lt;/P&gt;

&lt;P&gt;I should be able to do a few tweaks later on today.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jul 2015 00:41:01 GMT</pubDate>
    <dc:creator>Amohlmann</dc:creator>
    <dc:date>2015-07-22T00:41:01Z</dc:date>
    <item>
      <title>Is there a streamstats function that will show a running result of each value in a row being multiplied by the result above?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-streamstats-function-that-will-show-a-running-result/m-p/130978#M35722</link>
      <description>&lt;P&gt;I have a search that returns the survival rate over time. For instance:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Time                SurvivalRate     
1                        0.98                    
2                        0.96                     
3                        0.65
4                        1
.                          .
.                          .
.                          .
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to show a running survival rate that is like streamstats sum(survivalRate), but instead of adding the numbers in each new line, it multiplies it. So it would return something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Time                SurvivalRate     RunningSurvivalRate
1                        0.98                    0.98
2                        0.96                    0.9408 (0.98 * 0.96)
3                        0.65                    0.61152 (0.9408 * 0.65)
4                        1                       0.61125 (0.61152 * 1)
.                          .
.                          .
.                          .
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Am I using the wrong tool for this job? Is there a streamstats function that I am ignorant of?&lt;BR /&gt;
Thanks for the assistance.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 04:03:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-streamstats-function-that-will-show-a-running-result/m-p/130978#M35722</guid>
      <dc:creator>Amohlmann</dc:creator>
      <dc:date>2015-07-21T04:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a streamstats function that will show a running result of each value in a row being multiplied by the result above?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-streamstats-function-that-will-show-a-running-result/m-p/130979#M35723</link>
      <description>&lt;P&gt;I believe you'll want to use the "window=2" parameter to streamstats, then calculate using first(SurvivalRate) and last(RunningSurvivalRate).&lt;/P&gt;

&lt;P&gt;Something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(search that returns the above results) 
| streamstats window=2 last(SurvivalRate) as old_value first(RunningSurvivalRate) as new_value 
| eval RunningSurvivalRate=old_value*new_value
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Obviously you'll probably have to tweak that, especially with regards to which item is first and which is last because I always get those mixed up.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 16:31:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-streamstats-function-that-will-show-a-running-result/m-p/130979#M35723</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2015-07-21T16:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a streamstats function that will show a running result of each value in a row being multiplied by the result above?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-streamstats-function-that-will-show-a-running-result/m-p/130980#M35724</link>
      <description>&lt;P&gt;Thanks, it is almost there, I now have access to the previous result, but not the previous result of the runningSurvivalRate.&lt;/P&gt;

&lt;P&gt;I will have a play using this when I get a chance. You really helped. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 22:47:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-streamstats-function-that-will-show-a-running-result/m-p/130980#M35724</guid>
      <dc:creator>Amohlmann</dc:creator>
      <dc:date>2015-07-21T22:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a streamstats function that will show a running result of each value in a row being multiplied by the result above?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-streamstats-function-that-will-show-a-running-result/m-p/130981#M35725</link>
      <description>&lt;P&gt;Hi @Amohlmann&lt;/P&gt;

&lt;P&gt;Once you come up with a final search, would you be able to share that here? I think other users would find the solution useful. &lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 00:30:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-streamstats-function-that-will-show-a-running-result/m-p/130981#M35725</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2015-07-22T00:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a streamstats function that will show a running result of each value in a row being multiplied by the result above?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-streamstats-function-that-will-show-a-running-result/m-p/130982#M35726</link>
      <description>&lt;P&gt;I absolutely will. I marked this answer as correct as it gave me what I was looking for which was a new way to use streamstats.&lt;/P&gt;

&lt;P&gt;I should be able to do a few tweaks later on today.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 00:41:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-streamstats-function-that-will-show-a-running-result/m-p/130982#M35726</guid>
      <dc:creator>Amohlmann</dc:creator>
      <dc:date>2015-07-22T00:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a streamstats function that will show a running result of each value in a row being multiplied by the result above?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-streamstats-function-that-will-show-a-running-result/m-p/130983#M35727</link>
      <description>&lt;P&gt;That is a really good start but not quite perfect.&lt;BR /&gt;
I think a slightly better start is to use:&lt;BR /&gt;
    | streamstats list(survivalRate)&lt;/P&gt;

&lt;P&gt;Is there a way to multiply all the different values in a multivalue field?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 07:05:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-streamstats-function-that-will-show-a-running-result/m-p/130983#M35727</guid>
      <dc:creator>Amohlmann</dc:creator>
      <dc:date>2015-07-22T07:05:35Z</dc:date>
    </item>
  </channel>
</rss>

