<?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: Average Timespan in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Average-Timespan/m-p/163808#M46533</link>
    <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Service=MyApp source="C:\Logs\MyApp-Performance.log" process=Update| eval duration=strptime(timeElapsed,"%H:%M:%S.%6Q")-relative_time(now(),"@d") | stats avg(duration) as avgTimeElapsed 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The field timeElapsed is string to need to convert it to seconds before calculating avg.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Jul 2014 15:55:51 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-07-30T15:55:51Z</dc:date>
    <item>
      <title>Average Timespan</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-Timespan/m-p/163806#M46531</link>
      <description>&lt;P&gt;I have a large amount of logs in the following format:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;2014-07-30 14:23:51,802 - MyApp - 6 - INFO - Performance - process=Update, timeElapsed=00:00:00.0940611&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;I have a filter which displays only these entries:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Service=MyApp source="C:\Logs\MyApp-Performance.log" process=Update&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Would someone be able to explain how I can update this go that it give me the average timeElapsed across all entries for the selected period? &lt;/P&gt;

&lt;P&gt;Apologies, I'm new to this and have tried a few different things but can't seem to figure it out.&lt;/P&gt;

&lt;P&gt;Thanks in advance,&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2014 15:42:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-Timespan/m-p/163806#M46531</guid>
      <dc:creator>RagtimeWilly</dc:creator>
      <dc:date>2014-07-30T15:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Average Timespan</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-Timespan/m-p/163807#M46532</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;you can append an | stats avg(timeElapsed) to your search query.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2014 15:46:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-Timespan/m-p/163807#M46532</guid>
      <dc:creator>tom_frotscher</dc:creator>
      <dc:date>2014-07-30T15:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Average Timespan</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-Timespan/m-p/163808#M46533</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Service=MyApp source="C:\Logs\MyApp-Performance.log" process=Update| eval duration=strptime(timeElapsed,"%H:%M:%S.%6Q")-relative_time(now(),"@d") | stats avg(duration) as avgTimeElapsed 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The field timeElapsed is string to need to convert it to seconds before calculating avg.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2014 15:55:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-Timespan/m-p/163808#M46533</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-30T15:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Average Timespan</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-Timespan/m-p/163809#M46534</link>
      <description>&lt;P&gt;Thanks for the response.&lt;/P&gt;

&lt;P&gt;This is one of the things I tried but I just get a message saying "No results found"&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2014 15:56:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-Timespan/m-p/163809#M46534</guid>
      <dc:creator>RagtimeWilly</dc:creator>
      <dc:date>2014-07-30T15:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Average Timespan</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-Timespan/m-p/163810#M46535</link>
      <description>&lt;P&gt;Take a look at:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.2/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.2/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2014 16:08:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-Timespan/m-p/163810#M46535</guid>
      <dc:creator>Jeff_Lightly_Sp</dc:creator>
      <dc:date>2014-07-30T16:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Average Timespan</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-Timespan/m-p/163811#M46536</link>
      <description>&lt;P&gt;This worked a charm! &lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2014 16:08:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-Timespan/m-p/163811#M46536</guid>
      <dc:creator>RagtimeWilly</dc:creator>
      <dc:date>2014-07-30T16:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Average Timespan</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Average-Timespan/m-p/163812#M46537</link>
      <description>&lt;P&gt;Yeah, sorry! Did't saw that the field is not properly converted for use with stats. But @somesoni2 got it!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2014 16:16:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Average-Timespan/m-p/163812#M46537</guid>
      <dc:creator>tom_frotscher</dc:creator>
      <dc:date>2014-07-30T16:16:54Z</dc:date>
    </item>
  </channel>
</rss>

