<?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 How to calculate the difference between 2 different events with the same field and group them by another field that they have in common? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-difference-between-2-different-events-with/m-p/222805#M65534</link>
    <description>&lt;P&gt;So lets say I have 4 events,&lt;BR /&gt;
                 name="karina" age="23"&lt;BR /&gt;
                 name="Karina" age = "67"&lt;BR /&gt;
                 name="George" age="45"&lt;BR /&gt;
                 name="George" age ="12"&lt;/P&gt;

&lt;P&gt;I want to be able to get the difference and group these events by the name field (or whatever field that they have in common) to be able to get something like,&lt;BR /&gt;
                name="Karina"  calc_age="44"&lt;BR /&gt;
                name="George" calc_age = "33"&lt;/P&gt;

&lt;P&gt;I tried using delta, but I always get negative numbers and  I don't know how to incorporate the group by in there.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 10:01:13 GMT</pubDate>
    <dc:creator>kar1na</dc:creator>
    <dc:date>2020-09-29T10:01:13Z</dc:date>
    <item>
      <title>How to calculate the difference between 2 different events with the same field and group them by another field that they have in common?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-difference-between-2-different-events-with/m-p/222805#M65534</link>
      <description>&lt;P&gt;So lets say I have 4 events,&lt;BR /&gt;
                 name="karina" age="23"&lt;BR /&gt;
                 name="Karina" age = "67"&lt;BR /&gt;
                 name="George" age="45"&lt;BR /&gt;
                 name="George" age ="12"&lt;/P&gt;

&lt;P&gt;I want to be able to get the difference and group these events by the name field (or whatever field that they have in common) to be able to get something like,&lt;BR /&gt;
                name="Karina"  calc_age="44"&lt;BR /&gt;
                name="George" calc_age = "33"&lt;/P&gt;

&lt;P&gt;I tried using delta, but I always get negative numbers and  I don't know how to incorporate the group by in there.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:01:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-difference-between-2-different-events-with/m-p/222805#M65534</guid>
      <dc:creator>kar1na</dc:creator>
      <dc:date>2020-09-29T10:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the difference between 2 different events with the same field and group them by another field that they have in common?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-difference-between-2-different-events-with/m-p/222806#M65535</link>
      <description>&lt;P&gt;You will need &lt;CODE&gt;eventstats&lt;/CODE&gt; OR &lt;CODE&gt;streamstats&lt;/CODE&gt;. Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; |  eventstats max(age) as max min(age) as min by name | eval diff=max-min | dedup name | table name max min diff
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Jun 2016 19:51:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-difference-between-2-different-events-with/m-p/222806#M65535</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-20T19:51:00Z</dc:date>
    </item>
  </channel>
</rss>

