<?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 on time only, without considering date in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Average-on-time-only-without-considering-date/m-p/362713#M66121</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Base quey
 | eval EndTime = if(Result="OK", _time-relative_time(_time,"@d"), null)
 | eval StartTime = if(LogType ="START", _time-relative_time(_time,"@d"), null)
 | stats Latest(StartTime) as StartTime Latest(EndTime) as EndTime by PackageName ExecutionInstanceGUID
 | eval Duration = (EndTime-StartTime)
 | where (Duration != "" OR Duration &amp;gt;= 0)
 | stats avg(EndTime) as AVGEndTime avg(Duration) as AVGDuration avg(StartTime) as AVGStartTime by PackageName
 | fieldformat AVGStartTime = strftime(AVGStartTime,"%H:%M:%S") 
 | fieldformat AVGEndTime = strftime(AVGEndTime,"%H:%M:%S") 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 23 Jun 2017 14:37:42 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-06-23T14:37:42Z</dc:date>
    <item>
      <title>Average on time only, without considering date</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Average-on-time-only-without-considering-date/m-p/362711#M66119</link>
      <description>&lt;P&gt;I have this query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; Base quey
| eval EndTime = if(Result="OK", _time, null)
| eval StartTime = if(LogType ="START", _time, null)
| stats Latest(StartTime) as StartTime Latest(EndTime) as EndTime by PackageName ExecutionInstanceGUID
| eval Duration = (EndTime-StartTime)
| where (Duration != "" OR Duration &amp;gt;= 0)
| stats avg(EndTime) as AVGEndTime avg(Duration) as AVGDuration avg(StartTime) as AVGStartTime by PackageName
| fieldformat AVGStartTime = strftime(AVGStartTime,"%H:%M:%S") 
| fieldformat AVGEndTime = strftime(AVGEndTime,"%H:%M:%S") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My problems is that in calculating the average on AVGStartTime and AVGEndTime he considers the day also.&lt;BR /&gt;
I'd like the average to be made just on the hour, minutes, seconds, not on the day.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 13:46:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Average-on-time-only-without-considering-date/m-p/362711#M66119</guid>
      <dc:creator>andreafebbo</dc:creator>
      <dc:date>2017-06-23T13:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Average on time only, without considering date</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Average-on-time-only-without-considering-date/m-p/362712#M66120</link>
      <description>&lt;P&gt;Show the output as it is now and then show the desired output.  I do not understand "the problem" and how "he considers the day" because that part is not in the search.  Show us the entire search.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 13:58:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Average-on-time-only-without-considering-date/m-p/362712#M66120</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-06-23T13:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Average on time only, without considering date</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Average-on-time-only-without-considering-date/m-p/362713#M66121</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Base quey
 | eval EndTime = if(Result="OK", _time-relative_time(_time,"@d"), null)
 | eval StartTime = if(LogType ="START", _time-relative_time(_time,"@d"), null)
 | stats Latest(StartTime) as StartTime Latest(EndTime) as EndTime by PackageName ExecutionInstanceGUID
 | eval Duration = (EndTime-StartTime)
 | where (Duration != "" OR Duration &amp;gt;= 0)
 | stats avg(EndTime) as AVGEndTime avg(Duration) as AVGDuration avg(StartTime) as AVGStartTime by PackageName
 | fieldformat AVGStartTime = strftime(AVGStartTime,"%H:%M:%S") 
 | fieldformat AVGEndTime = strftime(AVGEndTime,"%H:%M:%S") 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Jun 2017 14:37:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Average-on-time-only-without-considering-date/m-p/362713#M66121</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-06-23T14:37:42Z</dc:date>
    </item>
  </channel>
</rss>

