<?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 do I group 2 events based on a unique field and extract time of the duration between them? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-group-2-events-based-on-a-unique-field-and-extract-time/m-p/439704#M95825</link>
    <description>&lt;P&gt;@farhanzakaria,&lt;/P&gt;

&lt;P&gt;There are few different ways to get this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"your search" |stats count,earliest(_time) as start,latest(_time) as end by techid|eval duration=end-start|where duration &amp;gt;1 AND count&amp;gt;1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.0/SearchReference/Transaction"&gt;Transaction&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    "your search"|transaction techid startswith="Outbound Message" endswith="Inbound Message"|where duration&amp;gt;1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 18 Dec 2018 13:08:05 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2018-12-18T13:08:05Z</dc:date>
    <item>
      <title>How do I group 2 events based on a unique field and extract time of the duration between them?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-group-2-events-based-on-a-unique-field-and-extract-time/m-p/439703#M95824</link>
      <description>&lt;P&gt;My application always relies on backend service which we are using SOAP. Every successful SOAP call will always have 2 events — request and response. Both events will have one similar field with the same value which is technical id and this is unique to each call.&lt;/P&gt;

&lt;P&gt;Request:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2018-12-18 10:46:03,987 {uid=aaa@bb.com, techid=1074979098911391744, sid=9999} - Outbound Message - BackendOne

Response:
2018-12-18 10:46:04,549 {uid=aaa@bb.com, techid=1074979098911391744, sid=9999} - Inbound Message - BackendOne
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So based on these results, I'm supposed to extract duration required by each backend services which took more than 1000 ms to complete.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 11:13:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-group-2-events-based-on-a-unique-field-and-extract-time/m-p/439703#M95824</guid>
      <dc:creator>farhanzakaria</dc:creator>
      <dc:date>2018-12-18T11:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I group 2 events based on a unique field and extract time of the duration between them?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-group-2-events-based-on-a-unique-field-and-extract-time/m-p/439704#M95825</link>
      <description>&lt;P&gt;@farhanzakaria,&lt;/P&gt;

&lt;P&gt;There are few different ways to get this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"your search" |stats count,earliest(_time) as start,latest(_time) as end by techid|eval duration=end-start|where duration &amp;gt;1 AND count&amp;gt;1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.0/SearchReference/Transaction"&gt;Transaction&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    "your search"|transaction techid startswith="Outbound Message" endswith="Inbound Message"|where duration&amp;gt;1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Dec 2018 13:08:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-group-2-events-based-on-a-unique-field-and-extract-time/m-p/439704#M95825</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-12-18T13:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I group 2 events based on a unique field and extract time of the duration between them?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-group-2-events-based-on-a-unique-field-and-extract-time/m-p/439705#M95826</link>
      <description>&lt;P&gt;Thank you! The first answer would be the best as transaction would be really costly for my instance.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 04:10:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-group-2-events-based-on-a-unique-field-and-extract-time/m-p/439705#M95826</guid>
      <dc:creator>farhanzakaria</dc:creator>
      <dc:date>2018-12-19T04:10:06Z</dc:date>
    </item>
  </channel>
</rss>

