<?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 to calculate the time range between two events? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-time-range-between-two-events/m-p/228562#M67610</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;  ... | eval timea1=if(match(_raw,".*A\.1.*"),_time,null())
 | eval timeb1=if(match(_raw,".*B\.1.*"),_time,null()) 
  | eval Tab1=timea1-timeb1 
  | table timea1 timeb2 Tab1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Something like that, but we need more details such as what your field names are, etc to make it a more appropriate answer.&lt;/P&gt;</description>
    <pubDate>Sat, 25 Jun 2016 14:22:56 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2016-06-25T14:22:56Z</dc:date>
    <item>
      <title>How to calculate the time range between two events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-time-range-between-two-events/m-p/228560#M67608</link>
      <description>&lt;P&gt;I have data like below. How do I calculate the time difference between A.1-B. 1, A.2-B.2......A.n-B.n&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Time Offset Word1
978         Start                      -------&amp;gt; A.1
1152           Start                           -------&amp;gt; A.2
1358           Start                           -------&amp;gt; A.3
1375           Controller                    -------&amp;gt; B.1
1569           Start                             -------&amp;gt; A.4
1577           Controller                    -------&amp;gt; B.2
1771           Controller                    -------&amp;gt; B.3
1965           Start                              -------&amp;gt; A.5
2095           Controller                     -------&amp;gt; B.4
2167           Start                               -------&amp;gt; A.6
2348           Start                               -------&amp;gt; A.7
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jun 2016 07:52:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-time-range-between-two-events/m-p/228560#M67608</guid>
      <dc:creator>shenjunwei</dc:creator>
      <dc:date>2016-06-24T07:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the time range between two events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-time-range-between-two-events/m-p/228561#M67609</link>
      <description>&lt;P&gt;Is this data already in Splunk? Have all the fields been extracted? What is the name of the field that has A.1, A.2 etc?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 18:13:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-time-range-between-two-events/m-p/228561#M67609</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-24T18:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the time range between two events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-time-range-between-two-events/m-p/228562#M67610</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;  ... | eval timea1=if(match(_raw,".*A\.1.*"),_time,null())
 | eval timeb1=if(match(_raw,".*B\.1.*"),_time,null()) 
  | eval Tab1=timea1-timeb1 
  | table timea1 timeb2 Tab1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Something like that, but we need more details such as what your field names are, etc to make it a more appropriate answer.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jun 2016 14:22:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-time-range-between-two-events/m-p/228562#M67610</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-06-25T14:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the time range between two events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-time-range-between-two-events/m-p/228563#M67611</link>
      <description>&lt;P&gt;Yes, these data are already in Splunk. A.1, A.2 ,etc are not in the data field, the data is just like "978            Start ".&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2016 01:13:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-time-range-between-two-events/m-p/228563#M67611</guid>
      <dc:creator>shenjunwei</dc:creator>
      <dc:date>2016-06-27T01:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the time range between two events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-time-range-between-two-events/m-p/228564#M67612</link>
      <description>&lt;P&gt;Thanks for your answer. May be I didn't explain so clearly， A.1, A.2, B.1 are not in the event. The real data is just like&lt;BR /&gt;
     978            Start&lt;BR /&gt;&lt;BR /&gt;
     1152           Start&lt;BR /&gt;&lt;BR /&gt;
     1358           Start&lt;BR /&gt;&lt;BR /&gt;
     1375           Controller&lt;BR /&gt;&lt;BR /&gt;
     1569           Start&lt;BR /&gt;&lt;BR /&gt;
     1577           Controller&lt;BR /&gt;&lt;BR /&gt;
     1771           Controller&lt;BR /&gt;&lt;BR /&gt;
     1965           Start&lt;BR /&gt;&lt;BR /&gt;
     2095           Controller&lt;BR /&gt;&lt;BR /&gt;
     2167           Start&lt;BR /&gt;&lt;BR /&gt;
     2348           Start&lt;BR /&gt;&lt;BR /&gt;
Is there any way which could calculate the difference between first start and controller, and the subsequence?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2016 01:19:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-time-range-between-two-events/m-p/228564#M67612</guid>
      <dc:creator>shenjunwei</dc:creator>
      <dc:date>2016-06-27T01:19:21Z</dc:date>
    </item>
  </channel>
</rss>

