<?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 Calculate elapsed time from two events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556665#M158098</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm sure I'm not the first to ask this question, but I can't seem to find an answer that covers what I am trying to achieve.&lt;/P&gt;&lt;P&gt;I have an index which collects job stats - start, end, fail, success etc&lt;/P&gt;&lt;P&gt;What I would like to do is create a table to display all the jobs I am interested in in one column, then the start, end and run times and a status column.&amp;nbsp; Like this -&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column A&amp;nbsp; &amp;nbsp; &amp;nbsp;Column B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Column C&amp;nbsp; &amp;nbsp;Column D&amp;nbsp; Column E&lt;/P&gt;&lt;P&gt;Jobname&amp;nbsp; &amp;nbsp; &amp;nbsp;Start Time&amp;nbsp; &amp;nbsp; &amp;nbsp; End Time&amp;nbsp; &amp;nbsp; Run Time&amp;nbsp; &amp;nbsp; Status&lt;/P&gt;&lt;P&gt;abc&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;08:00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 08:01&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Success&lt;/P&gt;&lt;P&gt;The search below gives me everything EXCEPT I cannot calculate 'Run Time' because the events are separate.&amp;nbsp; I've tried with 'streamstats' and 'transaction' without any success.&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;index=foo sourcetype=bar_prd "p-foo*" earliest=-6h&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;| rex "JOB: (?&amp;lt;j&amp;gt;p-foo-[a-z\-]+)"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;| rex "STATUS: (?&amp;lt;s&amp;gt;\w+)\s"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;| eval ST=if(s="RUNNING",_time,"")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;| eval ET=if(s="SUCCESS",_time,"")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;| eval Status=if(s="SUCCESS","Success","")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;| eval ST=strftime(ST,"%Y-%m-%d %H:%M:%S.%Q")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;| eval ET=strftime(ET,"%Y-%m-%d %H:%M:%S.%Q")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;| stats values(ST) as "Start Time", values(ET) as "End Time", values(Status) by j&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As ever, I'd be very grateful for assistance.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Jun 2021 11:32:35 GMT</pubDate>
    <dc:creator>timrich66</dc:creator>
    <dc:date>2021-06-22T11:32:35Z</dc:date>
    <item>
      <title>Calculate elapsed time from two events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556665#M158098</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm sure I'm not the first to ask this question, but I can't seem to find an answer that covers what I am trying to achieve.&lt;/P&gt;&lt;P&gt;I have an index which collects job stats - start, end, fail, success etc&lt;/P&gt;&lt;P&gt;What I would like to do is create a table to display all the jobs I am interested in in one column, then the start, end and run times and a status column.&amp;nbsp; Like this -&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column A&amp;nbsp; &amp;nbsp; &amp;nbsp;Column B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Column C&amp;nbsp; &amp;nbsp;Column D&amp;nbsp; Column E&lt;/P&gt;&lt;P&gt;Jobname&amp;nbsp; &amp;nbsp; &amp;nbsp;Start Time&amp;nbsp; &amp;nbsp; &amp;nbsp; End Time&amp;nbsp; &amp;nbsp; Run Time&amp;nbsp; &amp;nbsp; Status&lt;/P&gt;&lt;P&gt;abc&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;08:00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 08:01&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Success&lt;/P&gt;&lt;P&gt;The search below gives me everything EXCEPT I cannot calculate 'Run Time' because the events are separate.&amp;nbsp; I've tried with 'streamstats' and 'transaction' without any success.&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;index=foo sourcetype=bar_prd "p-foo*" earliest=-6h&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;| rex "JOB: (?&amp;lt;j&amp;gt;p-foo-[a-z\-]+)"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;| rex "STATUS: (?&amp;lt;s&amp;gt;\w+)\s"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;| eval ST=if(s="RUNNING",_time,"")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;| eval ET=if(s="SUCCESS",_time,"")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;| eval Status=if(s="SUCCESS","Success","")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;| eval ST=strftime(ST,"%Y-%m-%d %H:%M:%S.%Q")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;| eval ET=strftime(ET,"%Y-%m-%d %H:%M:%S.%Q")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="terminal,monaco"&gt;| stats values(ST) as "Start Time", values(ET) as "End Time", values(Status) by j&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As ever, I'd be very grateful for assistance.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 11:32:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556665#M158098</guid>
      <dc:creator>timrich66</dc:creator>
      <dc:date>2021-06-22T11:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate elapsed time from two events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556666#M158099</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/77822"&gt;@timrich66&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try by adding below search at the end of your search.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval "Run Time"=round(strptime('End Time',"%H:%M") - strptime('Start Time',"%H:%M"))/60&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 11:50:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556666#M158099</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-06-22T11:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate elapsed time from two events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556686#M158103</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;afraid I've tried that and it doesn't return anything&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 13:23:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556686#M158103</guid>
      <dc:creator>timrich66</dc:creator>
      <dc:date>2021-06-22T13:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate elapsed time from two events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556693#M158105</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/77822"&gt;@timrich66&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should work. Check this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="Jobname,Start Time,End Time,Status
abc,08:00,08:01,Success
"| multikv forceheader=1
| table Jobname Start_Time End_Time Status
| eval "Run Time"=round(strptime('End_Time',"%H:%M") - strptime('Start_Time',"%H:%M"))/60&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please share sample OP from your main search?&lt;/P&gt;&lt;P&gt;KV&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 13:33:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556693#M158105</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-06-22T13:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate elapsed time from two events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556699#M158107</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That search returns no results in my environment&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="timrich66_1-1624369588964.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14745i2A9BAAAB1B8559E4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="timrich66_1-1624369588964.png" alt="timrich66_1-1624369588964.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is the (partially) working search&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="timrich66_0-1624369548035.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14744iDBEDCD6FC9C26307/image-size/medium?v=v2&amp;amp;px=400" role="button" title="timrich66_0-1624369548035.png" alt="timrich66_0-1624369548035.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 13:47:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556699#M158107</guid>
      <dc:creator>timrich66</dc:creator>
      <dc:date>2021-06-22T13:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate elapsed time from two events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556702#M158108</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/77822"&gt;@timrich66&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="Jobname,Start Time,End Time,Status
abc,2021-06-22 11:45:00.000,2021-06-22 11:46:21.000,Success
"| multikv forceheader=1
| table Jobname Start_Time End_Time Status
| eval "Run Time (In Sec)"= round(strptime('End_Time',"%Y-%m-%d %H:%M:%S.%3N") - strptime('Start_Time',"%Y-%m-%d %H:%M:%S.%3N")),"Run Time"=tostring('Run Time (In Sec)',"duration")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-06-22 at 7.35.54 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14746iB0EF6DEFD42F08D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-06-22 at 7.35.54 PM.png" alt="Screenshot 2021-06-22 at 7.35.54 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated. &lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 14:06:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556702#M158108</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-06-22T14:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate elapsed time from two events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556705#M158109</link>
      <description>&lt;P&gt;That works for me -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="timrich66_0-1624371623632.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14747i70E7B707F20C16A9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="timrich66_0-1624371623632.png" alt="timrich66_0-1624371623632.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried adding the eval to my original search but no results found&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 14:21:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556705#M158109</guid>
      <dc:creator>timrich66</dc:creator>
      <dc:date>2021-06-22T14:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate elapsed time from two events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556706#M158110</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/77822"&gt;@timrich66&lt;/a&gt;&amp;nbsp; Can you please check time format of start time and end Time ??&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 14:23:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556706#M158110</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-06-22T14:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate elapsed time from two events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556822#M158145</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both Start and End Time use _time which is in the format %d/%m/%Y %H:%M:%S e.g.&amp;nbsp;&lt;SPAN class="t"&gt;23/06/2021&lt;/SPAN&gt; &lt;SPAN class="t"&gt;09:05:05&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The strftime format to return to human readable is -&amp;nbsp;"%Y-%m-%d %H:%M:%S.%Q"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is that what you need?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 08:18:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556822#M158145</guid>
      <dc:creator>timrich66</dc:creator>
      <dc:date>2021-06-23T08:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate elapsed time from two events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556825#M158147</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=foo sourcetype=bar_prd "p-foo*" earliest=-6h
| rex "JOB: (?&amp;lt;j&amp;gt;p-foo-[a-z\-]+)"
| rex "STATUS: (?&amp;lt;s&amp;gt;\w+)\s"
| eval ST=if(s="RUNNING",_time,"")
| eval ET=if(s="SUCCESS",_time,"")
| eval Status=if(s="SUCCESS","Success","")
| stats values(ST) as ST, values(ET) as ET, values(Status) as Status by j
| eval RT=ET-ST
| eval ST=strftime(ST,"%Y-%m-%d %H:%M:%S.%Q")
| eval ET=strftime(ET,"%Y-%m-%d %H:%M:%S.%Q")
| rename ST as "Start Time", ET as "End Time", RT as "Run Time"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Jun 2021 08:30:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556825#M158147</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-06-23T08:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate elapsed time from two events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556836#M158156</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;thanks for this.&amp;nbsp; It is one of the variations I tried before posting.&amp;nbsp; In my environment, 'RT' is not being calculated or displayed using that search -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="timrich66_0-1624439512546.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14766i556C98B4ACB0F0E8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="timrich66_0-1624439512546.png" alt="timrich66_0-1624439512546.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 09:12:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556836#M158156</guid>
      <dc:creator>timrich66</dc:creator>
      <dc:date>2021-06-23T09:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate elapsed time from two events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556837#M158157</link>
      <description>&lt;P&gt;Try using null() instead of ""&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=foo sourcetype=bar_prd "p-foo*" earliest=-6h
| rex "JOB: (?&amp;lt;j&amp;gt;p-foo-[a-z\-]+)"
| rex "STATUS: (?&amp;lt;s&amp;gt;\w+)\s"
| eval ST=if(s="RUNNING",_time,null())
| eval ET=if(s="SUCCESS",_time,null())
| eval Status=if(s="SUCCESS","Success","")
| stats values(ST) as ST, values(ET) as ET, values(Status) as Status by j
| eval RT=ET-ST
| eval ST=strftime(ST,"%Y-%m-%d %H:%M:%S.%Q")
| eval ET=strftime(ET,"%Y-%m-%d %H:%M:%S.%Q")
| rename ST as "Start Time", ET as "End Time", RT as "Run Time"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Jun 2021 09:18:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556837#M158157</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-06-23T09:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate elapsed time from two events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556838#M158158</link>
      <description>&lt;P&gt;You've cracked it!&amp;nbsp; Thank you very much&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 09:29:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-elapsed-time-from-two-events/m-p/556838#M158158</guid>
      <dc:creator>timrich66</dc:creator>
      <dc:date>2021-06-23T09:29:49Z</dc:date>
    </item>
  </channel>
</rss>

