<?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 Average duration in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Average-duration/m-p/108607#M28284</link>
    <description>&lt;P&gt;What is the syntax to obtain the average duration for each severity type in a query? A field exists called app_duration=0d 0h 40m 3s.   I need the average for each severity type.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 24 May 2011 18:16:10 GMT</pubDate>
    <dc:creator>DTERM</dc:creator>
    <dc:date>2011-05-24T18:16:10Z</dc:date>
    <item>
      <title>Average duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-duration/m-p/108607#M28284</link>
      <description>&lt;P&gt;What is the syntax to obtain the average duration for each severity type in a query? A field exists called app_duration=0d 0h 40m 3s.   I need the average for each severity type.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2011 18:16:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-duration/m-p/108607#M28284</guid>
      <dc:creator>DTERM</dc:creator>
      <dc:date>2011-05-24T18:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Average duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-duration/m-p/108608#M28285</link>
      <description>&lt;P&gt;First convert the &lt;CODE&gt;app_duration&lt;/CODE&gt; to a format &lt;EM&gt;convert&lt;/EM&gt; can use.  Then, use convert to store &lt;CODE&gt;app_duration&lt;/CODE&gt; in seconds.  Next, average all seconds by &lt;CODE&gt;severity_type&lt;/CODE&gt;.  Finally, re-format &lt;CODE&gt;avg_app_duration&lt;/CODE&gt; for each &lt;CODE&gt;severity_type&lt;/CODE&gt; in the human readable format of HH:MM:SS.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval app_duration=replace(replace(replace(app_duration,"d\s","+"),"h|m|s",""),"\s",":") 
| convert dur2sec(app_duration) 
| stats avg(app_duration) as avg_app_duration by severity_type 
| eval avg_app_duration=tostring(round(avg_app_duration,0),"duration")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 May 2011 18:51:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-duration/m-p/108608#M28285</guid>
      <dc:creator>bwooden</dc:creator>
      <dc:date>2011-05-24T18:51:36Z</dc:date>
    </item>
  </channel>
</rss>

