<?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 get the average time for latest event and previous event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-the-average-time-for-latest-event-and-previous-event/m-p/349092#M174599</link>
    <description>&lt;P&gt;I am looking for a solution to show for every latest event time and previous event time average duration (and the time span between them). Please help me to get this sorted out ( duration time : 19/06/2017 14:03:23.000 - 19/06/2017 14:03:21.000 = 0.2 min).&lt;/P&gt;

&lt;P&gt;Latest event:&lt;/P&gt;

&lt;P&gt;19/06/2017&lt;BR /&gt;
14:03:23.000&lt;BR /&gt;&lt;BR /&gt;
    &amp;lt;[H8C8B5E4487854A2] Request sent&lt;/P&gt;

&lt;P&gt;Previous Event:&lt;/P&gt;

&lt;P&gt;19/06/2017&lt;BR /&gt;
14:03:21.000&lt;BR /&gt;&lt;BR /&gt;
    &amp;lt;[H8C8B5E4487854A2] Request sent&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jun 2017 06:14:57 GMT</pubDate>
    <dc:creator>remoharish</dc:creator>
    <dc:date>2017-06-19T06:14:57Z</dc:date>
    <item>
      <title>how to get the average time for latest event and previous event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-the-average-time-for-latest-event-and-previous-event/m-p/349092#M174599</link>
      <description>&lt;P&gt;I am looking for a solution to show for every latest event time and previous event time average duration (and the time span between them). Please help me to get this sorted out ( duration time : 19/06/2017 14:03:23.000 - 19/06/2017 14:03:21.000 = 0.2 min).&lt;/P&gt;

&lt;P&gt;Latest event:&lt;/P&gt;

&lt;P&gt;19/06/2017&lt;BR /&gt;
14:03:23.000&lt;BR /&gt;&lt;BR /&gt;
    &amp;lt;[H8C8B5E4487854A2] Request sent&lt;/P&gt;

&lt;P&gt;Previous Event:&lt;/P&gt;

&lt;P&gt;19/06/2017&lt;BR /&gt;
14:03:21.000&lt;BR /&gt;&lt;BR /&gt;
    &amp;lt;[H8C8B5E4487854A2] Request sent&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 06:14:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-the-average-time-for-latest-event-and-previous-event/m-p/349092#M174599</guid>
      <dc:creator>remoharish</dc:creator>
      <dc:date>2017-06-19T06:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the average time for latest event and previous event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-get-the-average-time-for-latest-event-and-previous-event/m-p/349093#M174600</link>
      <description>&lt;P&gt;use streamstats. &lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.6.0/SearchReference/Streamstats"&gt;http://docs.splunk.com/Documentation/SplunkCloud/6.6.0/SearchReference/Streamstats&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|sort 0 transaction _time
|streamstats window=1 current=f values(_time) as prevTime count as order by transaction
|eval deltaTime=_time-prevTime
|eval avgTime=(_time+prevTime)/2
|eventstats max(order) as maxOrder by transaction
|where maxOrder=order
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Jun 2017 11:40:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-get-the-average-time-for-latest-event-and-previous-event/m-p/349093#M174600</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-06-19T11:40:33Z</dc:date>
    </item>
  </channel>
</rss>

