<?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: Suggestions on calculating reduction rates over a period of time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Suggestions-on-calculating-reduction-rates-over-a-period-of-time/m-p/191885#M55219</link>
    <description>&lt;P&gt;use "delta" command for the difference in the current Vs previous value for the given parameter. &lt;/P&gt;

&lt;P&gt;Refer for more details : &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Delta"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Delta&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;E.g: For each event where the count field exists, compute the difference between count and its previous value and store the result in countdiff.&lt;/P&gt;

&lt;P&gt;... | delta count AS countdiff&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jan 2015 02:59:34 GMT</pubDate>
    <dc:creator>jayannah</dc:creator>
    <dc:date>2015-01-13T02:59:34Z</dc:date>
    <item>
      <title>Suggestions on calculating reduction rates over a period of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Suggestions-on-calculating-reduction-rates-over-a-period-of-time/m-p/191884#M55218</link>
      <description>&lt;P&gt;I am new to Splunk and need guidance on writing a generic search that will give me the percent increase over a two month period. For example, let's say my event data has the following fields:&lt;/P&gt;

&lt;P&gt;page="foo.html", success_rate=99.0, _time=2014-12-01 &lt;BR /&gt;
page="foo.html", success_rate=99.5, _time=2014-11-01&lt;BR /&gt;
page="bar.html", success_rate=100, _time=2014-12-01 &lt;BR /&gt;
page="bar.html", success_rate=100, _time=2014-11-01 &lt;/P&gt;

&lt;P&gt;I would like my results to be:&lt;/P&gt;

&lt;P&gt;Page Name | Success Rate Change&lt;BR /&gt;
foo.html      | -0.5&lt;BR /&gt;
bar.html      | 0&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Here is another example:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Events&lt;/STRONG&gt;&lt;BR /&gt;
page="foo.html", response_time=40, _time=2014-11-1&lt;BR /&gt;
page="foo.html", response_time=50, _time=2014-12-1&lt;BR /&gt;
page="bar.html", response_time=3, _time=2014-11-1&lt;BR /&gt;
page="bar.html", response_time=1, _time=2014-12-1&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Desired Results&lt;/STRONG&gt;&lt;BR /&gt;
Page | Response Time Percent Increase&lt;BR /&gt;
foo.html | 25&lt;BR /&gt;
bar.html | -66.66&lt;/P&gt;

&lt;P&gt;This shows foo.html's response time grew 25% and bar.html's reduced 66% from Nov to Dec.&lt;/P&gt;

&lt;P&gt;I've gotten this to work with the follow query:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| eval month=strftime(_time,"%b") | chart avg(success_rate) by page, month &lt;BR /&gt;
 | convert num("Dec") as dec_res num("Nov") as nov_res&lt;BR /&gt;
 | eval rs_diff = (((dec_res / nov_res) * 100) - 100) &lt;BR /&gt;
 | table page rs_diff&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;However, this is not very flexible as I have to get the column by the month's name. This will only work for a month and then I have to change it.&lt;/P&gt;

&lt;P&gt;How can I get the same results without using hard-coded values? &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:40:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Suggestions-on-calculating-reduction-rates-over-a-period-of-time/m-p/191884#M55218</guid>
      <dc:creator>jjones31</dc:creator>
      <dc:date>2020-09-28T18:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Suggestions on calculating reduction rates over a period of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Suggestions-on-calculating-reduction-rates-over-a-period-of-time/m-p/191885#M55219</link>
      <description>&lt;P&gt;use "delta" command for the difference in the current Vs previous value for the given parameter. &lt;/P&gt;

&lt;P&gt;Refer for more details : &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Delta"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.1/SearchReference/Delta&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;E.g: For each event where the count field exists, compute the difference between count and its previous value and store the result in countdiff.&lt;/P&gt;

&lt;P&gt;... | delta count AS countdiff&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jan 2015 02:59:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Suggestions-on-calculating-reduction-rates-over-a-period-of-time/m-p/191885#M55219</guid>
      <dc:creator>jayannah</dc:creator>
      <dc:date>2015-01-13T02:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Suggestions on calculating reduction rates over a period of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Suggestions-on-calculating-reduction-rates-over-a-period-of-time/m-p/191886#M55220</link>
      <description>&lt;P&gt;Thanks for your response jayannah!&lt;/P&gt;

&lt;P&gt;You actually made me realize my example is misleading. Since success rate is already a percentage, your suggestion is completely valid. &lt;/P&gt;

&lt;P&gt;I am trying to create a search that will give me all events that's greater than a specific percentage (percent increase). For example, if I have a web page in which the response time has grown more than 10% in the past month, I want to know. &lt;/P&gt;

&lt;P&gt;Let me give you a better example, let's use response time instead of success rate. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Events&lt;/STRONG&gt;&lt;BR /&gt;
page="foo.html", response_time=40, _time=2014-11-1&lt;BR /&gt;
page="foo.html", response_time=50, _time=2014-12-1&lt;BR /&gt;
page="bar.html", response_time=3, _time=2014-11-1&lt;BR /&gt;
page="bar.html", response_time=1, _time=2014-12-1&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Desired Results&lt;/STRONG&gt;&lt;BR /&gt;
Page        |        Response Time Percent Increase&lt;BR /&gt;
foo.html  |       25&lt;BR /&gt;
bar.html |       -66.66&lt;/P&gt;

&lt;P&gt;This shows foo.html's response time grew 25% and bar.html's reduced 66% from Nov to Dec. &lt;/P&gt;

&lt;P&gt;Any help is appreciated! &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:37:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Suggestions-on-calculating-reduction-rates-over-a-period-of-time/m-p/191886#M55220</guid>
      <dc:creator>jjones31</dc:creator>
      <dc:date>2020-09-28T18:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Suggestions on calculating reduction rates over a period of time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Suggestions-on-calculating-reduction-rates-over-a-period-of-time/m-p/191887#M55221</link>
      <description>&lt;P&gt;The below line will add new field previous_response_time with value of response_time of previous event.&lt;/P&gt;

&lt;P&gt;| streamstats current=f last(response_time) as previous_response_time&lt;/P&gt;

&lt;P&gt;Then, the below query gives you the % you want..&lt;/P&gt;

&lt;P&gt;eval  Perc_change= ((response_time - previous_response_time) /previous_response_time  * 100)&lt;/P&gt;

&lt;P&gt;Hope this helps..&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:37:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Suggestions-on-calculating-reduction-rates-over-a-period-of-time/m-p/191887#M55221</guid>
      <dc:creator>jayannah</dc:creator>
      <dc:date>2020-09-28T18:37:49Z</dc:date>
    </item>
  </channel>
</rss>

