<?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 create difference of two values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407723#M117735</link>
    <description>&lt;P&gt;Q1: How can I get c4 where c4 will always be the difference of values in c3 against max of c2 - min of c2&lt;/P&gt;

&lt;P&gt;For example: Here c4 for A = 677-76&lt;/P&gt;

&lt;P&gt;Please guide.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;c    c2   c3
A   1   76
A   2   7
A   3   6
A   4   677
B   1   65
B   2   675
B   3   90
B   4   78
C   1   121
C   2   56
C   3   54
C   4   67
D   1   56
D   2   6
D   3   5
D   4   657
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 04 Jun 2019 16:53:31 GMT</pubDate>
    <dc:creator>reverse</dc:creator>
    <dc:date>2019-06-04T16:53:31Z</dc:date>
    <item>
      <title>How to create difference of two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407723#M117735</link>
      <description>&lt;P&gt;Q1: How can I get c4 where c4 will always be the difference of values in c3 against max of c2 - min of c2&lt;/P&gt;

&lt;P&gt;For example: Here c4 for A = 677-76&lt;/P&gt;

&lt;P&gt;Please guide.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;c    c2   c3
A   1   76
A   2   7
A   3   6
A   4   677
B   1   65
B   2   675
B   3   90
B   4   78
C   1   121
C   2   56
C   3   54
C   4   67
D   1   56
D   2   6
D   3   5
D   4   657
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Jun 2019 16:53:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407723#M117735</guid>
      <dc:creator>reverse</dc:creator>
      <dc:date>2019-06-04T16:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create difference of two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407724#M117736</link>
      <description>&lt;P&gt;@Vijeta please guide.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 17:01:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407724#M117736</guid>
      <dc:creator>reverse</dc:creator>
      <dc:date>2019-06-04T17:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to create difference of two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407725#M117737</link>
      <description>&lt;P&gt;@reverse try using delta command and see if that works.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 17:23:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407725#M117737</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-06-04T17:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to create difference of two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407726#M117738</link>
      <description>&lt;P&gt;Could you please post an example.. dont know that command..thank you &lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 17:30:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407726#M117738</guid>
      <dc:creator>reverse</dc:creator>
      <dc:date>2019-06-04T17:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to create difference of two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407727#M117739</link>
      <description>&lt;P&gt;Tried that .. it is continuing for all rows .. i want it by c1.. delta is not taking by clause &lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 17:33:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407727#M117739</guid>
      <dc:creator>reverse</dc:creator>
      <dc:date>2019-06-04T17:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create difference of two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407728#M117740</link>
      <description>&lt;P&gt;Try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="yourindex" sourcetype="yoursourcetype" 
| stats max(c3) as max min(c3) as min by c 
| eval c4=max-min
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Jun 2019 17:38:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407728#M117740</guid>
      <dc:creator>kmorris_splunk</dc:creator>
      <dc:date>2019-06-04T17:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to create difference of two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407729#M117741</link>
      <description>&lt;P&gt;@reverse ok I see you changed the question.  Try below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your query&amp;gt;
 | stats max(c3) as max, min(c3) as min by c 
 | eval c4=max-min
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Jun 2019 17:41:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407729#M117741</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-06-04T17:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to create difference of two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407730#M117742</link>
      <description>&lt;P&gt;This is not producing the intended results &lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 17:42:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407730#M117742</guid>
      <dc:creator>reverse</dc:creator>
      <dc:date>2019-06-04T17:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to create difference of two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407731#M117743</link>
      <description>&lt;P&gt;Please see the example &lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 17:43:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407731#M117743</guid>
      <dc:creator>reverse</dc:creator>
      <dc:date>2019-06-04T17:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to create difference of two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407732#M117744</link>
      <description>&lt;P&gt;Not producing the intended result..&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 17:46:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407732#M117744</guid>
      <dc:creator>reverse</dc:creator>
      <dc:date>2019-06-04T17:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to create difference of two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407733#M117745</link>
      <description>&lt;P&gt;I need the difference of c2 against c3 values as mentioned in the example &lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 17:48:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407733#M117745</guid>
      <dc:creator>reverse</dc:creator>
      <dc:date>2019-06-04T17:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to create difference of two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407734#M117746</link>
      <description>&lt;P&gt;Is this what you were looking for?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="yourindex" sourcetype="yoursourcetype" 
| eventstats min(c3) as min max(c3) as max by c 
| eval c4=max-min 
| table c c2 c3 c4 
| sort c c2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Jun 2019 17:50:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407734#M117746</guid>
      <dc:creator>kmorris_splunk</dc:creator>
      <dc:date>2019-06-04T17:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create difference of two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407735#M117747</link>
      <description>&lt;P&gt;@reverse &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;your query&amp;gt;| sort c c2
  | stats first(c3) as first, last(c3) as last by c 
  | eval c4=last - first
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Jun 2019 17:55:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407735#M117747</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-06-04T17:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to create difference of two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407736#M117748</link>
      <description>&lt;P&gt;This worked but i had to add eventstats. .. was getting blank with stats&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 18:00:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407736#M117748</guid>
      <dc:creator>reverse</dc:creator>
      <dc:date>2019-06-04T18:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to create difference of two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407737#M117749</link>
      <description>&lt;P&gt;Thanks a ton @Vijeta .. Kindly help here as well..&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/750417/playing-with-data-ii.html?minQuestionBodyLength=80"&gt;https://answers.splunk.com/answers/750417/playing-with-data-ii.html?minQuestionBodyLength=80&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 18:03:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407737#M117749</guid>
      <dc:creator>reverse</dc:creator>
      <dc:date>2019-06-04T18:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create difference of two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407738#M117750</link>
      <description>&lt;P&gt;Good to know. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 18:03:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-difference-of-two-values/m-p/407738#M117750</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-06-04T18:03:04Z</dc:date>
    </item>
  </channel>
</rss>

