<?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: Percentage difference between two successive events as a new field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Percentage-difference-between-two-successive-events-as-a-new/m-p/50403#M12115</link>
    <description>&lt;P&gt;:blush: You noticed! Yep, I did some testing with 5m buckets.&lt;/P&gt;

&lt;P&gt;And yes, I'll be there. Looking forward to that beer! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Sep 2012 13:01:42 GMT</pubDate>
    <dc:creator>echalex</dc:creator>
    <dc:date>2012-09-04T13:01:42Z</dc:date>
    <item>
      <title>Percentage difference between two successive events as a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-difference-between-two-successive-events-as-a-new/m-p/50400#M12112</link>
      <description>&lt;P&gt;So a quick and dirty one.&lt;/P&gt;

&lt;P&gt;If I have a search that gives me a daily summary of the bytes downloaded by web users:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="web_logs" | timechart span=1d sum(sc_bytes) AS "Daily Traffic (Bytes)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What would be the best way to compare two successive days and give a % increase/decrease value? e.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time                      Daily Traffic    perc_diff
8/9/11  12:00:00.000 AM    318606425        0
8/10/11 12:00:00.000 AM    66560892         -79.10
8/11/11 12:00:00.000 AM    2987269232       4388.02
8/12/11 12:00:00.000 AM    7981047          -99.73
8/13/11 12:00:00.000 AM    160388640        1909.61 
8/14/11 12:00:00.000 AM    52523918         -67.25
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope someone can help.. I have Splunkers block &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2012 11:37:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-difference-between-two-successive-events-as-a-new/m-p/50400#M12112</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2012-09-04T11:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage difference between two successive events as a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-difference-between-two-successive-events-as-a-new/m-p/50401#M12113</link>
      <description>&lt;P&gt;Hi R.Turk,&lt;/P&gt;

&lt;P&gt;I think you should be succesful using &lt;CODE&gt;bucket&lt;/CODE&gt;, &lt;CODE&gt;delta&lt;/CODE&gt; and &lt;CODE&gt;eval&lt;/CODE&gt;. Use &lt;CODE&gt;bucket&lt;/CODE&gt; to group the results into daily sets, &lt;CODE&gt;stats&lt;/CODE&gt; to calculate the daily sum, &lt;CODE&gt;delta&lt;/CODE&gt; to calculate the change and &lt;CODE&gt;eval&lt;/CODE&gt; to get the percentage.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|bucket _time span=1d | stats sum(sc_bytes) as sc_bytes_daily by _time |delta sc_bytes_daily as change |eval change_percent=change/(sc_bytes_daily-change)*100 |timechart span=1d  first(sc_bytes_daily) AS "Daily traffic (bytes)", first(change_percent) AS "Change (%)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;HTH&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2012 12:51:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-difference-between-two-successive-events-as-a-new/m-p/50401#M12113</guid>
      <dc:creator>echalex</dc:creator>
      <dc:date>2012-09-04T12:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage difference between two successive events as a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-difference-between-two-successive-events-as-a-new/m-p/50402#M12114</link>
      <description>&lt;P&gt;Thanks echalex! That's exactly what I was after! I was going to ask you why the 5 minute spans, but you edited it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; If you're heading to .conf2012, I'll be sure to buy you a beer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2012 12:56:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-difference-between-two-successive-events-as-a-new/m-p/50402#M12114</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2012-09-04T12:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage difference between two successive events as a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-difference-between-two-successive-events-as-a-new/m-p/50403#M12115</link>
      <description>&lt;P&gt;:blush: You noticed! Yep, I did some testing with 5m buckets.&lt;/P&gt;

&lt;P&gt;And yes, I'll be there. Looking forward to that beer! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2012 13:01:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-difference-between-two-successive-events-as-a-new/m-p/50403#M12115</guid>
      <dc:creator>echalex</dc:creator>
      <dc:date>2012-09-04T13:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage difference between two successive events as a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-difference-between-two-successive-events-as-a-new/m-p/50404#M12116</link>
      <description>&lt;P&gt;Well done! I was playing with an alternate solution, but not using &lt;CODE&gt;bucket&lt;/CODE&gt; - noticed that bucket reduced the memory used during the search by a factor of 3 in my case. The job runtimes were similar for both searches. K.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2012 13:44:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-difference-between-two-successive-events-as-a-new/m-p/50404#M12116</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-09-04T13:44:41Z</dc:date>
    </item>
  </channel>
</rss>

