<?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: Splunk 640: How to eval the difference between events' values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-640-How-to-eval-the-difference-between-events-values/m-p/241435#M71802</link>
    <description>&lt;P&gt;Hello Javiergn,&lt;BR /&gt;
It  works partially. See below.&lt;/P&gt;

&lt;P&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/1337i3AADC146662A536C/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;It should be as below.&lt;/P&gt;

&lt;P&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/1338i13A1AB6C357FBD3A/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 09 May 2016 12:48:13 GMT</pubDate>
    <dc:creator>htkwan</dc:creator>
    <dc:date>2016-05-09T12:48:13Z</dc:date>
    <item>
      <title>Splunk 640: How to eval the difference between events' values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-640-How-to-eval-the-difference-between-events-values/m-p/241433#M71800</link>
      <description>&lt;P&gt;Hello Everybody,&lt;BR /&gt;
I've a table (w/o the yellow column), as shown below. I want to eval another field (in yellow). It shows the difference between the LatestValue, by Category2, TagName, FiscalDate (number). Pls. advise. Thanks.&lt;/P&gt;

&lt;P&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/1339iAA6B96B1267462CF/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2016 11:07:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-640-How-to-eval-the-difference-between-events-values/m-p/241433#M71800</guid>
      <dc:creator>htkwan</dc:creator>
      <dc:date>2016-05-09T11:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 640: How to eval the difference between events' values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-640-How-to-eval-the-difference-between-events-values/m-p/241434#M71801</link>
      <description>&lt;P&gt;You want to use delta:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search here
| delta LatestValue as Diff p=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;By the way, make sure your events are sorted first. For instance:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search here
| sort FiscalDate
| delta LatestValue as Diff p=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you need something more granular, such as only sum those where category and tag match then you can use streamstats probably or maybe just sort by FiscalDate, Category2, TagName.&lt;/P&gt;

&lt;P&gt;Let me know if the above works for you anyway&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2016 11:13:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-640-How-to-eval-the-difference-between-events-values/m-p/241434#M71801</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-05-09T11:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 640: How to eval the difference between events' values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-640-How-to-eval-the-difference-between-events-values/m-p/241435#M71802</link>
      <description>&lt;P&gt;Hello Javiergn,&lt;BR /&gt;
It  works partially. See below.&lt;/P&gt;

&lt;P&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/1337i3AADC146662A536C/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;It should be as below.&lt;/P&gt;

&lt;P&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/1338i13A1AB6C357FBD3A/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2016 12:48:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-640-How-to-eval-the-difference-between-events-values/m-p/241435#M71802</guid>
      <dc:creator>htkwan</dc:creator>
      <dc:date>2016-05-09T12:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 640: How to eval the difference between events' values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-640-How-to-eval-the-difference-between-events-values/m-p/241436#M71803</link>
      <description>&lt;P&gt;If you don't want the negative numbers then simply append the following to your search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Diff = if (Diff &amp;lt; 0, "", Diff)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 May 2016 12:59:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-640-How-to-eval-the-difference-between-events-values/m-p/241436#M71803</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-05-09T12:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 640: How to eval the difference between events' values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-640-How-to-eval-the-difference-between-events-values/m-p/241437#M71804</link>
      <description>&lt;P&gt;You could do as @javiergn suggested (set Diff to "" if negative). The risk with that if there are negative Diffs within a tag, you would lose those. Another option would be to use &lt;CODE&gt;streamstats&lt;/CODE&gt; and group by &lt;CODE&gt;tag&lt;/CODE&gt;. Like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search here | streamstats window=1 current=f first(LatestValue) as NextValue by TagName | eval Diff=LatestValue-NextValue
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 May 2016 13:21:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-640-How-to-eval-the-difference-between-events-values/m-p/241437#M71804</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-05-09T13:21:43Z</dc:date>
    </item>
  </channel>
</rss>

