<?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 durations between 1 start event and multiple end events? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-durations-between-1-start-event-and/m-p/153955#M43251</link>
    <description>&lt;P&gt;Work perfectly, thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Aug 2015 14:28:31 GMT</pubDate>
    <dc:creator>collier31200</dc:creator>
    <dc:date>2015-08-04T14:28:31Z</dc:date>
    <item>
      <title>How to calculate the durations between 1 start event and multiple end events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-durations-between-1-start-event-and/m-p/153952#M43248</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;

&lt;P&gt;How do I get the time between one start event and multiple end events?&lt;/P&gt;

&lt;P&gt;Let me explain: &lt;BR /&gt;
I have one start event and multiple end events and I need to see the duration between the start event and each of the end events.&lt;BR /&gt;
Currently I'm using the following search, but only raised the duration between the start event and the first end event.&lt;BR /&gt;
This search correctly displays all the other occurrences of end events, but without the durations &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;my search | transaction startswith="Status update" endswith="Mount"  keepevicted=t  | sort 0 _time | table _time Update Mounted duration _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please helppp !! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 13:33:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-durations-between-1-start-event-and/m-p/153952#M43248</guid>
      <dc:creator>collier31200</dc:creator>
      <dc:date>2015-08-04T13:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the durations between 1 start event and multiple end events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-durations-between-1-start-event-and/m-p/153953#M43249</link>
      <description>&lt;P&gt;What about something like this instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval start_time=if(searchmatch("Status update"),_time,null()) | streamstats last(start_time) as last_start_time | eval duration=_time-last_start_time | search "Mount"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;1) We create a field start_time which if we have a start event (check out &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/SearchReference/CommonEvalFunctions"&gt;Eval Functions&lt;/A&gt; ), we set to the _time of the event, otherwise we don't set it at all.&lt;BR /&gt;
2) We then use &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/SearchReference/streamstats"&gt;streamstats&lt;/A&gt; to get the most recent start time for each event&lt;BR /&gt;
3) We then keep only the ending events&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 13:47:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-durations-between-1-start-event-and/m-p/153953#M43249</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-08-04T13:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the durations between 1 start event and multiple end events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-durations-between-1-start-event-and/m-p/153954#M43250</link>
      <description>&lt;P&gt;Assuming your transaction has another correlation field (e.g. a mountpoint/directory-name) which you did not specify (a big "if", I know), you can do it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eventstats earliest(_time) AS StartTime by correlationID | search "Mount" | eval duration=_time-StartTime | table _time Update Mounted duration _raw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Aug 2015 13:55:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-durations-between-1-start-event-and/m-p/153954#M43250</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-04T13:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the durations between 1 start event and multiple end events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-durations-between-1-start-event-and/m-p/153955#M43251</link>
      <description>&lt;P&gt;Work perfectly, thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 14:28:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-durations-between-1-start-event-and/m-p/153955#M43251</guid>
      <dc:creator>collier31200</dc:creator>
      <dc:date>2015-08-04T14:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the durations between 1 start event and multiple end events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-durations-between-1-start-event-and/m-p/153956#M43252</link>
      <description>&lt;P&gt;My transaction has not another correlation field :S..&lt;BR /&gt;
But thank you, this search will help for other stuff &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 14:31:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-durations-between-1-start-event-and/m-p/153956#M43252</guid>
      <dc:creator>collier31200</dc:creator>
      <dc:date>2015-08-04T14:31:14Z</dc:date>
    </item>
  </channel>
</rss>

