<?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 How to search the time difference between transactions? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-time-difference-between-transactions/m-p/224879#M66278</link>
    <description>&lt;P&gt;I have three statements in my log file for each transaction like below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc*  source="abc.log" 2410286283_b310-3358a1229709 INFO  

22/Jun/2016 13:52:21.318 [ Thread-2 ] INFO : ResponsePoll    - [STEP_ID = checkStatus ]{ message = "Status from server" , messageId = 2410286283_b310-3358a1229709, ResponseStatus = SUCCESS }
22/Jun/2016 13:52:20.957 [ cacher-0 ] INFO : cacher    - Cached [AppResponse{messageId='2410286283_b310-3358a1229709',  responseSubscriberName='client01'}]
22/Jun/2016 13:52:05.191 [ sender-3 ] INFO : MessageService    - [RequestStatus=Sent, Request=SuperVO{sessionId='2410286283_b310-3358a1229709', responseSubscriberName='client01'}]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to calculate the time between the statements having keyword &lt;CODE&gt;ResponseStatus = SUCCESS&lt;/CODE&gt; and &lt;CODE&gt;RequestStatus=Sent&lt;/CODE&gt; for each of the ID's like 2410286283_b310-3358a1229709.&lt;BR /&gt;
In the above case, I should get a result as: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2410286283_b310-3358a1229709   00:00:16:127
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to do this for various ID's in my logs through Splunk.&lt;BR /&gt;
Due to different naming standards followed in request &amp;amp; response for the ID, I am unable to think of a way to do this. &lt;/P&gt;

&lt;P&gt;Any insights or help appreciated.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jun 2016 14:34:06 GMT</pubDate>
    <dc:creator>ppatkar</dc:creator>
    <dc:date>2016-06-22T14:34:06Z</dc:date>
    <item>
      <title>How to search the time difference between transactions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-time-difference-between-transactions/m-p/224879#M66278</link>
      <description>&lt;P&gt;I have three statements in my log file for each transaction like below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc*  source="abc.log" 2410286283_b310-3358a1229709 INFO  

22/Jun/2016 13:52:21.318 [ Thread-2 ] INFO : ResponsePoll    - [STEP_ID = checkStatus ]{ message = "Status from server" , messageId = 2410286283_b310-3358a1229709, ResponseStatus = SUCCESS }
22/Jun/2016 13:52:20.957 [ cacher-0 ] INFO : cacher    - Cached [AppResponse{messageId='2410286283_b310-3358a1229709',  responseSubscriberName='client01'}]
22/Jun/2016 13:52:05.191 [ sender-3 ] INFO : MessageService    - [RequestStatus=Sent, Request=SuperVO{sessionId='2410286283_b310-3358a1229709', responseSubscriberName='client01'}]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to calculate the time between the statements having keyword &lt;CODE&gt;ResponseStatus = SUCCESS&lt;/CODE&gt; and &lt;CODE&gt;RequestStatus=Sent&lt;/CODE&gt; for each of the ID's like 2410286283_b310-3358a1229709.&lt;BR /&gt;
In the above case, I should get a result as: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2410286283_b310-3358a1229709   00:00:16:127
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to do this for various ID's in my logs through Splunk.&lt;BR /&gt;
Due to different naming standards followed in request &amp;amp; response for the ID, I am unable to think of a way to do this. &lt;/P&gt;

&lt;P&gt;Any insights or help appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 14:34:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-time-difference-between-transactions/m-p/224879#M66278</guid>
      <dc:creator>ppatkar</dc:creator>
      <dc:date>2016-06-22T14:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the time difference between transactions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-time-difference-between-transactions/m-p/224880#M66279</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc* source="abc.log" ResponseStatus="SUCCESS" OR ResponseStatus="Sent" | eval sid=coalesce(sessionId, messageId) | streamstats window=1 current=f earliest(_time) as start by sid | eval duration=tostring(_time-start, "duration")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jun 2016 18:48:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-time-difference-between-transactions/m-p/224880#M66279</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-22T18:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the time difference between transactions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-time-difference-between-transactions/m-p/224881#M66280</link>
      <description>&lt;P&gt;@sundareshr : Thanks for your help ! I slightly modified your answer &amp;amp; got it to work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc* source="abc.log"  "ResponseStatus = SUCCESS" OR "RequestStatus=Sent"  | eval sid=coalesce(replace(sessionId,"'",""), messageId) |  stats range(_time) as duration by sid 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Jun 2016 04:59:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-time-difference-between-transactions/m-p/224881#M66280</guid>
      <dc:creator>ppatkar</dc:creator>
      <dc:date>2016-06-23T04:59:08Z</dc:date>
    </item>
  </channel>
</rss>

