<?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: Calculate duration of two different events in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Calculate-duration-of-two-different-events/m-p/579250#M102265</link>
    <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;range&lt;/FONT&gt; function should do the job.&amp;nbsp; It computes the difference between the first and last events.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=infra_automation sourcetype=rundeck_execution
| stats range(_time) as duration, latest(status) as last_status by job_id
| sort - job_id
| eval duration = tostring(duration,"duration")
| table job_id data time last_status duration&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Dec 2021 22:02:12 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2021-12-24T22:02:12Z</dc:date>
    <item>
      <title>Calculate duration of two different events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Calculate-duration-of-two-different-events/m-p/579248#M102264</link>
      <description>&lt;P&gt;I have logs which shows the job status ( Running, succeeded and failed) and all jobs have unique job id , now I want to calculate the duration it took to get failed or succeeded for each job id. Here, all jobs id would have two event first one -running and second - succeeded or failed.&amp;nbsp; How it can be done&amp;nbsp;&lt;/P&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="Splunk.PNG" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17339i29A91FBDA1170A81/image-size/large?v=v2&amp;amp;px=999" role="button" title="Splunk.PNG" alt="Splunk.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 21:23:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Calculate-duration-of-two-different-events/m-p/579248#M102264</guid>
      <dc:creator>rishabhpatel20</dc:creator>
      <dc:date>2021-12-24T21:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate duration of two different events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Calculate-duration-of-two-different-events/m-p/579250#M102265</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;range&lt;/FONT&gt; function should do the job.&amp;nbsp; It computes the difference between the first and last events.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=infra_automation sourcetype=rundeck_execution
| stats range(_time) as duration, latest(status) as last_status by job_id
| sort - job_id
| eval duration = tostring(duration,"duration")
| table job_id data time last_status duration&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 22:02:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Calculate-duration-of-two-different-events/m-p/579250#M102265</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-12-24T22:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate duration of two different events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Calculate-duration-of-two-different-events/m-p/579255#M102266</link>
      <description>&lt;P&gt;Thanks a lot&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;.. I was trying with other options like appendcol etc but did not go through the basic one range..&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Sat, 25 Dec 2021 10:15:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Calculate-duration-of-two-different-events/m-p/579255#M102266</guid>
      <dc:creator>rishabhpatel20</dc:creator>
      <dc:date>2021-12-25T10:15:50Z</dc:date>
    </item>
  </channel>
</rss>

