<?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 Duration between messages in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Duration-between-messages/m-p/358148#M65385</link>
    <description>&lt;P&gt;Hi, I have messages in Splunk like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{ [-] 
id: ABC
message: test1
timestamp: 2017-08-07T16:38:38+00:00 }
{ [-] 
id: BAC
message: test2 
source: client 
timestamp: 2017-08-07T16:38:38+00:00 }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;These messages show up for each id. I would like to get duration between the first message "test" showing up and the second message "test2" by id. Maybe get the average duration for both messages showing up after tying each message to an id.&lt;/P&gt;

&lt;P&gt;So basically, how can I get the average duration per ID How can I do that in Splunk?&lt;/P&gt;

&lt;P&gt;For duplicate ids, I need to get the worst duration for that ID. So no duplicates. Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 07 Aug 2017 16:46:58 GMT</pubDate>
    <dc:creator>wscott12</dc:creator>
    <dc:date>2017-08-07T16:46:58Z</dc:date>
    <item>
      <title>Duration between messages</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Duration-between-messages/m-p/358148#M65385</link>
      <description>&lt;P&gt;Hi, I have messages in Splunk like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{ [-] 
id: ABC
message: test1
timestamp: 2017-08-07T16:38:38+00:00 }
{ [-] 
id: BAC
message: test2 
source: client 
timestamp: 2017-08-07T16:38:38+00:00 }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;These messages show up for each id. I would like to get duration between the first message "test" showing up and the second message "test2" by id. Maybe get the average duration for both messages showing up after tying each message to an id.&lt;/P&gt;

&lt;P&gt;So basically, how can I get the average duration per ID How can I do that in Splunk?&lt;/P&gt;

&lt;P&gt;For duplicate ids, I need to get the worst duration for that ID. So no duplicates. Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 16:46:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Duration-between-messages/m-p/358148#M65385</guid>
      <dc:creator>wscott12</dc:creator>
      <dc:date>2017-08-07T16:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Duration between messages</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Duration-between-messages/m-p/358149#M65386</link>
      <description>&lt;P&gt;One approach, although not the fastest, is to use &lt;CODE&gt;transaction&lt;/CODE&gt;.  This command automatically computes the time difference between the starting and ending events and stores the result in a field called 'duration'.  You can then calculate an average of that field.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | transaction guid startswith="analyticsLoaded" endswith="doneWithAnalytics" | stats avg(duration) as AvgDuration by guid
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Aug 2017 19:14:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Duration-between-messages/m-p/358149#M65386</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-08-07T19:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Duration between messages</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Duration-between-messages/m-p/358150#M65387</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats range(_time) AS gap BY guid
| stats avg(gap)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Aug 2017 19:17:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Duration-between-messages/m-p/358150#M65387</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-08-08T19:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Duration between messages</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Duration-between-messages/m-p/358151#M65388</link>
      <description>&lt;P&gt;I updated the question please check&lt;/P&gt;</description>
      <pubDate>Sat, 12 Aug 2017 06:16:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Duration-between-messages/m-p/358151#M65388</guid>
      <dc:creator>wscott12</dc:creator>
      <dc:date>2017-08-12T06:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Duration between messages</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Duration-between-messages/m-p/358152#M65389</link>
      <description>&lt;P&gt;Both of the answers assume that hte guid was supposed to be the same between the two messages.  Is that accurate?  If so, please edit the question to make those the same.  If not, please edit to indicate how the programmer is going to determine that those two messages are in any way related to each other.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 12 Aug 2017 20:49:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Duration-between-messages/m-p/358152#M65389</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-12T20:49:53Z</dc:date>
    </item>
  </channel>
</rss>

