<?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 can I calculate the timediff based on non-sequential sequence IDs? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-timediff-based-on-non-sequential/m-p/411728#M168660</link>
    <description>&lt;P&gt;Works like a charm! Perfect.&lt;BR /&gt;
Thanks so much! &lt;/P&gt;</description>
    <pubDate>Thu, 28 Jun 2018 20:12:46 GMT</pubDate>
    <dc:creator>khavildar</dc:creator>
    <dc:date>2018-06-28T20:12:46Z</dc:date>
    <item>
      <title>How can I calculate the timediff based on non-sequential sequence IDs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-timediff-based-on-non-sequential/m-p/411726#M168658</link>
      <description>&lt;P&gt;I have a requirement wherein I have to find timedifference of 2 events. Below is an example on the event type:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Host    Time          SeqID      Transaction
a          1:00:00      5               Start
b          1:30:00      7               Start
a          1:45:00      9               Complete
b          2:00:00      14             Complete
a          4:00:00      19             Start
c           4:30:00      23             Start
a          4:45:00       25            Complete
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to calculate the timedifferences between 'Start' and 'Complete' for every Host using their SeqID. &lt;BR /&gt;
To translate roughly, its like &lt;BR /&gt;
concat(hostname,Time@Complete,SeqId@Complete) - concat(hostname,Time@Start,SeqID@Start) &lt;BR /&gt;
But in the above calculation, i need to ensure the SeqID@Complete is the most numerically nearest one to the SeqID@Start.&lt;/P&gt;

&lt;P&gt;Any thoughts / suggestions?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 22:52:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-timediff-based-on-non-sequential/m-p/411726#M168658</guid>
      <dc:creator>khavildar</dc:creator>
      <dc:date>2018-06-27T22:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: How can I calculate the timediff based on non-sequential sequence IDs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-timediff-based-on-non-sequential/m-p/411727#M168659</link>
      <description>&lt;P&gt;Hi @khavildar,&lt;/P&gt;

&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="your index"  "your other search terms"|table _time,host,SeqID ,Transaction|sort host,SeqID |streamstats current=f last(_time) as prev by host|eval time_diff=_time-prev|where Transaction="Complete"|table host,SeqID ,time_diff
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Jun 2018 01:29:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-timediff-based-on-non-sequential/m-p/411727#M168659</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-06-28T01:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: How can I calculate the timediff based on non-sequential sequence IDs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-timediff-based-on-non-sequential/m-p/411728#M168660</link>
      <description>&lt;P&gt;Works like a charm! Perfect.&lt;BR /&gt;
Thanks so much! &lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 20:12:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-calculate-the-timediff-based-on-non-sequential/m-p/411728#M168660</guid>
      <dc:creator>khavildar</dc:creator>
      <dc:date>2018-06-28T20:12:46Z</dc:date>
    </item>
  </channel>
</rss>

