<?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: would like to know how to get subtraction of field value in two different events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115287#M30537</link>
    <description>&lt;P&gt;You cannot do maths at index time, you're limited to regular expressions.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jul 2015 21:55:59 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2015-07-09T21:55:59Z</dc:date>
    <item>
      <title>would like to know how to get subtraction of field value in two different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115281#M30531</link>
      <description>&lt;P&gt;would like to know how to get subtraction of field value in two different events &lt;BR /&gt;
i mean i have event A with field sum = 15 &lt;BR /&gt;
and event B with field sum = 20 &lt;BR /&gt;
i would like to create new field called diff that contain value = field of event B - field of  event A &lt;/P&gt;

&lt;P&gt;thanks in advance &lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 21:23:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115281#M30531</guid>
      <dc:creator>Ahmedkhalil</dc:creator>
      <dc:date>2015-07-09T21:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: would like to know how to get subtraction of field value in two different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115282#M30532</link>
      <description>&lt;P&gt;Hi Ahmedkhalil,&lt;/P&gt;

&lt;P&gt;you can use &lt;CODE&gt;streamstats&lt;/CODE&gt; to achieve it. Using &lt;CODE&gt;streamstats&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search here| streamstats current=f last(sum) AS last | eval diff=sum-last | table event sum diff
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 21:31:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115282#M30532</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-09T21:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: would like to know how to get subtraction of field value in two different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115283#M30533</link>
      <description>&lt;P&gt;i would like to get difference between two fields not summation &lt;BR /&gt;
and also this events is transaction&lt;BR /&gt;
so i need to get difference between events in same transaction &lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 21:38:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115283#M30533</guid>
      <dc:creator>Ahmedkhalil</dc:creator>
      <dc:date>2015-07-09T21:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: would like to know how to get subtraction of field value in two different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115284#M30534</link>
      <description>&lt;P&gt;What you are looking for is delta command&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/SearchReference/Delta"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.4/SearchReference/Delta&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 21:41:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115284#M30534</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2015-07-09T21:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: would like to know how to get subtraction of field value in two different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115285#M30535</link>
      <description>&lt;P&gt;Sorry my bad, I'm still a bit sleepy &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; BTW your question states it's two events and not one transaction event.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 21:54:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115285#M30535</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-09T21:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: would like to know how to get subtraction of field value in two different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115286#M30536</link>
      <description>&lt;P&gt;ok it's good start how can i do this task at index time not search time &lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 21:55:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115286#M30536</guid>
      <dc:creator>Ahmedkhalil</dc:creator>
      <dc:date>2015-07-09T21:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: would like to know how to get subtraction of field value in two different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115287#M30537</link>
      <description>&lt;P&gt;You cannot do maths at index time, you're limited to regular expressions.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 21:55:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115287#M30537</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-07-09T21:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: would like to know how to get subtraction of field value in two different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115288#M30538</link>
      <description>&lt;P&gt;Another addition; if this is really in a Splunk &lt;CODE&gt;transaction&lt;/CODE&gt; event, it will not work with &lt;CODE&gt;delta&lt;/CODE&gt; nor &lt;CODE&gt;streamstats&lt;/CODE&gt;. Both commands do their thing event based: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; For each event where field is a number, the delta command computes the difference, in search order, between the field value for the event and the field value for the previous event. The delta command writes this difference into newfield
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The same is with streamstats ....&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 22:09:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115288#M30538</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-09T22:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: would like to know how to get subtraction of field value in two different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115289#M30539</link>
      <description>&lt;P&gt;but below example from search referance delta examples and contain same example that i can use &lt;BR /&gt;
sourcetype=access_* | transaction JSESSIONID clientip startswith="view" endswith="purchase" | delta _time AS timeDelta p=1 | eval timeDelta=abs(timeDelta) | eval timeDelta=tostring(timeDelta,"duration")&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 23:32:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115289#M30539</guid>
      <dc:creator>Ahmedkhalil</dc:creator>
      <dc:date>2015-07-09T23:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: would like to know how to get subtraction of field value in two different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115290#M30540</link>
      <description>&lt;P&gt;ok but problem is that i will use this field many times in dashboards and it's alot of data So execute this search command each time will make reports and dashboard slow&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 23:33:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115290#M30540</guid>
      <dc:creator>Ahmedkhalil</dc:creator>
      <dc:date>2015-07-09T23:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: would like to know how to get subtraction of field value in two different events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115291#M30541</link>
      <description>&lt;P&gt;Yes, if your after transaction event has a single value field which can be used with &lt;CODE&gt;delta&lt;/CODE&gt; it will work....But you have a transaction with a multi value field called &lt;CODE&gt;sum&lt;/CODE&gt; and this cannot be used in &lt;CODE&gt;delta&lt;/CODE&gt; .....&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2015 01:13:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/would-like-to-know-how-to-get-subtraction-of-field-value-in-two/m-p/115291#M30541</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-10T01:13:48Z</dc:date>
    </item>
  </channel>
</rss>

