<?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: How calculate the delta between the timestamp in one row with the timestamp in the previous row for all results? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-calculate-the-delta-between-the-timestamp-in-one-row-with/m-p/211367#M41604</link>
    <description>&lt;P&gt;Have you considered the Delta command?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your search] | delta _time as OnSince  | eval OnSince = tostring (OnSince, "duration")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 23 Feb 2016 16:34:39 GMT</pubDate>
    <dc:creator>Stevelim</dc:creator>
    <dc:date>2016-02-23T16:34:39Z</dc:date>
    <item>
      <title>How calculate the delta between the timestamp in one row with the timestamp in the previous row for all results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-calculate-the-delta-between-the-timestamp-in-one-row-with/m-p/211366#M41603</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;In my search result, I have a series of events. I am able to calculate the delta of the various _time timestamps between each event, but how can I calculate the delta dividing the result in pairs? For example, I have 6 timestamps:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1 - 22/02/16 14:50:00.000
2 - 22/02/16 14:50:30.000
3 - 22/02/16 14:50:38.000
4 - 22/02/16 14:50:59.000
5 - 22/02/16 14:53:06.000
6 - 22/02/16 14:54:00.000
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need the delta between line 1 and line 2, then between line 3 and line 4, and so on for the entire result. Someone knows how to do something like this?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 12:52:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-calculate-the-delta-between-the-timestamp-in-one-row-with/m-p/211366#M41603</guid>
      <dc:creator>Brigno</dc:creator>
      <dc:date>2016-02-23T12:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: How calculate the delta between the timestamp in one row with the timestamp in the previous row for all results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-calculate-the-delta-between-the-timestamp-in-one-row-with/m-p/211367#M41604</link>
      <description>&lt;P&gt;Have you considered the Delta command?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your search] | delta _time as OnSince  | eval OnSince = tostring (OnSince, "duration")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Feb 2016 16:34:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-calculate-the-delta-between-the-timestamp-in-one-row-with/m-p/211367#M41604</guid>
      <dc:creator>Stevelim</dc:creator>
      <dc:date>2016-02-23T16:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: How calculate the delta between the timestamp in one row with the timestamp in the previous row for all results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-calculate-the-delta-between-the-timestamp-in-one-row-with/m-p/211368#M41605</link>
      <description>&lt;P&gt;Yes, I do. I know it, but it's not what I'm looking for. That command make a delta between line 1-2, 2-3, 3-4. 4-5 and so on, but what I really need is a delta between lines 1-2, 3-4, 5-6 etc.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 20:47:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-calculate-the-delta-between-the-timestamp-in-one-row-with/m-p/211368#M41605</guid>
      <dc:creator>Brigno</dc:creator>
      <dc:date>2016-02-23T20:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: How calculate the delta between the timestamp in one row with the timestamp in the previous row for all results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-calculate-the-delta-between-the-timestamp-in-one-row-with/m-p/211369#M41606</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your Base Search Here
| streamstats count AS serial
| eval copy_time=if(serial%2==1, _time, null())
| streamstats current=f last(copy_time) AS last_time
| eval delta = if(isnull(copy_time), tostring(last_time - _time, "duration"), null())
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 May 2018 06:24:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-calculate-the-delta-between-the-timestamp-in-one-row-with/m-p/211369#M41606</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-05-04T06:24:03Z</dc:date>
    </item>
  </channel>
</rss>

