<?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 Stats with different bins (full time period AND 5 min intervals)- How to compare average time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Stats-with-different-bins-full-time-period-AND-5-min-intervals/m-p/614530#M213581</link>
    <description>&lt;P&gt;I have a need to compare the average time for certain events with the 5 min bucket/bins of the same events. The idea is to find 5 min intervals that deviate more than a certain percentage from the average response times and then in some way display those intervals.&lt;/P&gt;
&lt;P&gt;I am however struggling to figure out how to output the Average for the entire time period but also calculate the 5 minute intervals.&lt;/P&gt;
&lt;P&gt;The following query, returns nothing (can you even do 2 Stats in the same query?):&lt;/P&gt;
&lt;P&gt;search | stats avg(Value) as AvgEntirePeriod | bin _time span=5m | stats avg(Value) by _time&lt;/P&gt;
&lt;P&gt;Any ideas on how to write this?&lt;/P&gt;</description>
    <pubDate>Mon, 26 Sep 2022 15:38:38 GMT</pubDate>
    <dc:creator>dmoberg</dc:creator>
    <dc:date>2022-09-26T15:38:38Z</dc:date>
    <item>
      <title>Stats with different bins (full time period AND 5 min intervals)- How to compare average time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-with-different-bins-full-time-period-AND-5-min-intervals/m-p/614530#M213581</link>
      <description>&lt;P&gt;I have a need to compare the average time for certain events with the 5 min bucket/bins of the same events. The idea is to find 5 min intervals that deviate more than a certain percentage from the average response times and then in some way display those intervals.&lt;/P&gt;
&lt;P&gt;I am however struggling to figure out how to output the Average for the entire time period but also calculate the 5 minute intervals.&lt;/P&gt;
&lt;P&gt;The following query, returns nothing (can you even do 2 Stats in the same query?):&lt;/P&gt;
&lt;P&gt;search | stats avg(Value) as AvgEntirePeriod | bin _time span=5m | stats avg(Value) by _time&lt;/P&gt;
&lt;P&gt;Any ideas on how to write this?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 15:38:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-with-different-bins-full-time-period-AND-5-min-intervals/m-p/614530#M213581</guid>
      <dc:creator>dmoberg</dc:creator>
      <dc:date>2022-09-26T15:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Stats with different bins (full time period AND 5 min intervals)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-with-different-bins-full-time-period-AND-5-min-intervals/m-p/614542#M213582</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248238"&gt;@dmoberg&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you can use eventstats to have the average of the full period, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;search 
| eventstats avg(Value) as AvgEntirePeriod
| bin _time span=5m 
| stats 
   avg(Value) AS AvgFiveMinutes 
   values(AvgEntirePeriod) AS AvgEntirePeriod 
   BY _time
| eval perc=round(AvgFiveMinutes/AvgEntirePeriod*100,2)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 11:51:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-with-different-bins-full-time-period-AND-5-min-intervals/m-p/614542#M213582</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-26T11:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Stats with different bins (full time period AND 5 min intervals)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-with-different-bins-full-time-period-AND-5-min-intervals/m-p/614543#M213583</link>
      <description>&lt;P&gt;You can do as many stats calls as you like in a query, but what you need is eventstats. Also timechart can be used to replace the bin and stats.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;search | timechart span=5m avg(Value) as binAvg | eventstats avg(binAvg) as allAvg&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 11:54:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-with-different-bins-full-time-period-AND-5-min-intervals/m-p/614543#M213583</guid>
      <dc:creator>andrew_nelson</dc:creator>
      <dc:date>2022-09-26T11:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: Stats with different bins (full time period AND 5 min intervals)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-with-different-bins-full-time-period-AND-5-min-intervals/m-p/614684#M213628</link>
      <description>&lt;P&gt;Thanks! The EventStats did the trick&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 07:28:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-with-different-bins-full-time-period-AND-5-min-intervals/m-p/614684#M213628</guid>
      <dc:creator>dmoberg</dc:creator>
      <dc:date>2022-09-27T07:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: Stats with different bins (full time period AND 5 min intervals)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-with-different-bins-full-time-period-AND-5-min-intervals/m-p/614688#M213630</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248238"&gt;@dmoberg&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 07:40:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-with-different-bins-full-time-period-AND-5-min-intervals/m-p/614688#M213630</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-27T07:40:15Z</dc:date>
    </item>
  </channel>
</rss>

