<?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: epoch time subraction gives negative values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/epoch-time-subraction-gives-negative-values/m-p/359810#M162131</link>
    <description>&lt;P&gt;Hi richgalloway,&lt;/P&gt;

&lt;P&gt;Timestamp order is correct. Time5 is new and Time6 is old and we want to subtract Time5 - Time6 only. This negative results not coming for all the events..only for specfic events we are getting the negative values. those negative values are updated in ticket&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Krishna&lt;/P&gt;</description>
    <pubDate>Tue, 20 Mar 2018 02:20:02 GMT</pubDate>
    <dc:creator>kishen2017</dc:creator>
    <dc:date>2018-03-20T02:20:02Z</dc:date>
    <item>
      <title>epoch time subraction gives negative values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/epoch-time-subraction-gives-negative-values/m-p/359808#M162129</link>
      <description>&lt;P&gt;Subtracting two timestamps results in negative values. Using epoch time to find the differences between two timestamp but the results comes in negative values.&lt;/P&gt;

&lt;P&gt;index=npp_pe_sumidx_slr003 | streamstats values(Time5) as new, values(Time6) as old | eval duration2=new-old | table new old  duration2 &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   T1                               T2                           Diff       
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;1521470540.030000   1521470540.290000   -0.260000 &lt;BR /&gt;
1521470596.110000   1521470596.360000   -0.250000 &lt;BR /&gt;
1521470620.090000   1521470620.310000   -0.220000 &lt;BR /&gt;
1521470588.020000   1521470588.240000   -0.220000 &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:32:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/epoch-time-subraction-gives-negative-values/m-p/359808#M162129</guid>
      <dc:creator>kishen2017</dc:creator>
      <dc:date>2020-09-29T18:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: epoch time subraction gives negative values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/epoch-time-subraction-gives-negative-values/m-p/359809#M162130</link>
      <description>&lt;P&gt;Are you sure you have the fields in the correct order?  Perhaps Time5 is old and Time6 is new?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 02:08:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/epoch-time-subraction-gives-negative-values/m-p/359809#M162130</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-03-20T02:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: epoch time subraction gives negative values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/epoch-time-subraction-gives-negative-values/m-p/359810#M162131</link>
      <description>&lt;P&gt;Hi richgalloway,&lt;/P&gt;

&lt;P&gt;Timestamp order is correct. Time5 is new and Time6 is old and we want to subtract Time5 - Time6 only. This negative results not coming for all the events..only for specfic events we are getting the negative values. those negative values are updated in ticket&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Krishna&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 02:20:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/epoch-time-subraction-gives-negative-values/m-p/359810#M162131</guid>
      <dc:creator>kishen2017</dc:creator>
      <dc:date>2018-03-20T02:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: epoch time subraction gives negative values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/epoch-time-subraction-gives-negative-values/m-p/359811#M162132</link>
      <description>&lt;P&gt;Have you verified the values of Time5 and Time6 are the same as what your ticketing system says?  If you just need to make sure you don't get a negative value for duration2 use &lt;CODE&gt;... | eval duration2=abs(new-old) | ...&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 03:24:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/epoch-time-subraction-gives-negative-values/m-p/359811#M162132</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-03-20T03:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: epoch time subraction gives negative values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/epoch-time-subraction-gives-negative-values/m-p/359812#M162133</link>
      <description>&lt;P&gt;@kishen2017, the negaive difference in the above example look correct to me.&lt;/P&gt;

&lt;P&gt;1521470540.290000 (T2) &amp;gt; 1521470540.030000 (T1). If you compare 29 &amp;gt; 03 and difference is 26. Since you are performing T1-T2 you are expected to get negative values. So you should perform T2-T1 as per your data.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 06:20:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/epoch-time-subraction-gives-negative-values/m-p/359812#M162133</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-20T06:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: epoch time subraction gives negative values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/epoch-time-subraction-gives-negative-values/m-p/538789#M162134</link>
      <description>&lt;P&gt;Hi kishen,&lt;/P&gt;&lt;P&gt;did you find the a solution for your problem? I struggle with the same problem at my calculation.&lt;/P&gt;&lt;P&gt;nanosam&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 15:39:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/epoch-time-subraction-gives-negative-values/m-p/538789#M162134</guid>
      <dc:creator>nanosam</dc:creator>
      <dc:date>2021-02-05T15:39:22Z</dc:date>
    </item>
  </channel>
</rss>

