<?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: Single value panel with trend based on avg(count) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565423#M197004</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it seems that the value of avg is referred to the actual minute, and not to the average of all the minutes in the 10m timespan...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've to take 10 values (one count for each minute in the last 10 minutes)&lt;/P&gt;&lt;P&gt;Make the average of those count&lt;/P&gt;&lt;P&gt;Have the treshold displaying if this average is increasing or decreasing&lt;/P&gt;</description>
    <pubDate>Wed, 01 Sep 2021 07:40:15 GMT</pubDate>
    <dc:creator>marco_carolo</dc:creator>
    <dc:date>2021-09-01T07:40:15Z</dc:date>
    <item>
      <title>Single value panel with trend based on avg(count)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565346#M196972</link>
      <description>&lt;P&gt;Hello there.&lt;/P&gt;&lt;P&gt;What I'm trying to do is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;search | bucket span=60s _time | stats count by _time | ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to achive if possible the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Calculate the average per minute of count of search (if I concatenate the stats avg(count) I get the actual value) but I can't:&lt;/LI&gt;&lt;LI&gt;Have the Single Value panel inside my dashboard to correctly display the trend based on average values.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Is there any way to achive this result?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the moment each try I do to compare those values is not going well &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 14:56:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565346#M196972</guid>
      <dc:creator>marco_carolo</dc:creator>
      <dc:date>2021-08-31T14:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Single value panel with trend based on avg(count)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565349#M196973</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233874"&gt;@marco_carolo&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand your need:&lt;/P&gt;&lt;P&gt;you want to display a value (average for minute of count of events) and you want e.g. the average of the last hour and the trend respect the previous hour , is it correct?&lt;/P&gt;&lt;P&gt;If this is your need, try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index
| bucket span=1m _time 
| stats count by _time
| bucket span=1h _time 
| stats avg(count) AS avg BY _time
| sort -_time
| head 2
| reverse&lt;/LI-CODE&gt;&lt;P&gt;as test you could see this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal
| head 1000000
| bucket span=1m _time
| stats count BY _time
| bucket span=1h _time
| stats avg(count) AS avg BY _time
| sort -_time
| head 2
| reverse&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 15:20:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565349#M196973</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-08-31T15:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Single value panel with trend based on avg(count)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565351#M196975</link>
      <description>&lt;P&gt;Ciao Giuseppe &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need to do, or better, what I was asked to do is this:&lt;/P&gt;&lt;P&gt;Get the avarage count of calls per minute in 10 minutes.&lt;/P&gt;&lt;P&gt;What I wanted to do is having the single value panel displaying the value of the current average per minute, plus the trend of the previous avarages per minute in 10 minutes timespan, so I can see if the value is increasing or decreasing.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 15:41:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565351#M196975</guid>
      <dc:creator>marco_carolo</dc:creator>
      <dc:date>2021-08-31T15:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Single value panel with trend based on avg(count)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565355#M196977</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233874"&gt;@marco_carolo&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you can use my search with a different timespan&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index
| bucket span=1m _time 
| stats count by _time
| bucket span=10m _time 
| stats avg(count) AS avg BY _time
| sort -_time
| head 2
| reverse&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 15:43:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565355#M196977</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-08-31T15:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Single value panel with trend based on avg(count)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565357#M196979</link>
      <description>&lt;P&gt;It seems that I'm having different results:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;search | bucket span=1m _time | stats count by _time | stats avg(count) is resulting now 386 (which seems to be correct, taken the average of all the value got by the count)&lt;/P&gt;&lt;P&gt;The result of your query is resulting 269...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 15:56:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565357#M196979</guid>
      <dc:creator>marco_carolo</dc:creator>
      <dc:date>2021-08-31T15:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Single value panel with trend based on avg(count)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565358#M196980</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233874"&gt;@marco_carolo&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;only for debugging, fix a past period of analysis: e.g. from -80 mites to -60 minutes, otherwise the results are continously changing!&lt;/P&gt;&lt;P&gt;Then, probably it's an error in the message, but, you need to use two times bucket, one before each stats.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 15:57:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565358#M196980</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-08-31T15:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Single value panel with trend based on avg(count)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565363#M196984</link>
      <description>&lt;P&gt;Bucketing is usually not needed if you just need to do a timeseries calculation. There's a separate command for this - timechart.&lt;/P&gt;&lt;P&gt;And I'd approach this by "adjusting" time...&lt;/P&gt;&lt;PRE&gt;&amp;lt;&amp;lt;your search&amp;gt;&amp;gt; | timechart count span=1m &lt;BR /&gt;| eventstats max(_time) as maxtime&lt;BR /&gt;| eval _time=if(_time=maxtime,maxtime,maxtime-60)&lt;BR /&gt;| stats avg(count) by _time&lt;/PRE&gt;&lt;P&gt;This way you get a value for the first minute and the average value per minute for the remainder of your search period. And now you can use the single value visualisation with a trend comparison to a value "a minute before".&lt;/P&gt;&lt;P&gt;EDIT: As this was marked as solution - please see my other solution further down the thread because this one was based on misunderstanding on what the OP really needed.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 12:53:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565363#M196984</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-01T12:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Single value panel with trend based on avg(count)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565421#M197003</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This search is giving me strange results... I expect result approx around 400 and I'm getting 12-16 instead...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 06:37:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565421#M197003</guid>
      <dc:creator>marco_carolo</dc:creator>
      <dc:date>2021-09-01T06:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Single value panel with trend based on avg(count)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565423#M197004</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it seems that the value of avg is referred to the actual minute, and not to the average of all the minutes in the 10m timespan...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've to take 10 values (one count for each minute in the last 10 minutes)&lt;/P&gt;&lt;P&gt;Make the average of those count&lt;/P&gt;&lt;P&gt;Have the treshold displaying if this average is increasing or decreasing&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 07:40:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565423#M197004</guid>
      <dc:creator>marco_carolo</dc:creator>
      <dc:date>2021-09-01T07:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Single value panel with trend based on avg(count)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565430#M197008</link>
      <description>&lt;P&gt;I don't understand &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I thought you wanted a value of count of events from the last minute and the average per-minute value from some previous minutes.&lt;/P&gt;&lt;P&gt;That's what this does. Firstly it calculates per-minute statistics with |timechart.&lt;/P&gt;&lt;P&gt;Then it adds a field containing a timestamp of the latest minute (so we can differentiate between the latest minute and the previous ones).&lt;/P&gt;&lt;P&gt;Then it rewrites the timestamp for the remainding minutes so they can be aggregated with stats.&lt;/P&gt;&lt;P&gt;And finally | stats avg(count) gives you two values - one is an "average" value from a single value from last minute and the other is an average calculated from previous minutes.&lt;/P&gt;&lt;P&gt;Is that not what you wanted?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 08:26:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565430#M197008</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-01T08:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Single value panel with trend based on avg(count)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565432#M197009</link>
      <description>&lt;P&gt;The request I got is to calculate the average calls to a specific function per minute, in a 10 minute window.&lt;/P&gt;&lt;P&gt;What my team leader expects is a single value. In the last 10 minute, this function is called &lt;SPAN&gt;averagely&amp;nbsp;&lt;/SPAN&gt;400 times per minute.&lt;/P&gt;&lt;P&gt;What I'm doing is setting the bucket, calling the count, and then calling the average over the got values.&lt;/P&gt;&lt;P&gt;What I want to add is the trend and&amp;nbsp; the sparkiline in a single counter panel inside my dashboard, so I can see if the average value is rising or decreasing.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 08:34:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565432#M197009</guid>
      <dc:creator>marco_carolo</dc:creator>
      <dc:date>2021-09-01T08:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Single value panel with trend based on avg(count)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565447#M197016</link>
      <description>&lt;P&gt;Ahhh... I thought you wanted to have a value from last minute compared to an average of previous values.&lt;/P&gt;&lt;P&gt;But you simply want a moving average over a sliding window.&lt;/P&gt;&lt;P&gt;Just use the timechart (as I wrote before - it's a dedicated command for analysing time series so there's no need to fiddle manually with buckets) and do a streamstats.&lt;/P&gt;&lt;PRE&gt;&amp;lt;&amp;lt;your_search&amp;gt;&amp;gt; | timechart count span=1m | streamstats window=10 avg(count)&lt;/PRE&gt;&lt;P&gt;Alternatively you can use |trendline&lt;/P&gt;&lt;PRE&gt;&amp;lt;&amp;lt;your_search&amp;gt;&amp;gt; | timechart count span=1m |&amp;nbsp; trendline sma10(count)&lt;/PRE&gt;&lt;P&gt;Remember than with time aligned to full minutes you might want to set your search time range to full minutes otherwise you'll get "not-full" values at the ends of the range since they correspond to only fractions of a minute.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 09:36:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565447#M197016</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-01T09:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Single value panel with trend based on avg(count)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565449#M197018</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Can you be more specific about how to get full values instead of partial for each minute?&lt;/P&gt;&lt;P&gt;I need to achive that...&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 09:45:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565449#M197018</guid>
      <dc:creator>marco_carolo</dc:creator>
      <dc:date>2021-09-01T09:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Single value panel with trend based on avg(count)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565463#M197024</link>
      <description>&lt;P&gt;If you do at - let's say - 10:35:15 a |timechart with span=1m over last 5 minutes, you'll get data from 10:30:15 to 10:35:15 split into a minute-long buckets, &lt;STRONG&gt;aligned at full minutes&lt;/STRONG&gt;. So you'll get 6 buckets - one containing events from 10:30:15 to :10:31:00, another one from 10:31:00 to 10:32:00 and so on up to 10:35:00-10:35:15.&lt;/P&gt;&lt;P&gt;Obviously, the first and last buckets will be smaller than the rest of them.&lt;/P&gt;&lt;P&gt;That's the default behaviour of the |timechart&lt;/P&gt;&lt;P&gt;You can however use partial=f option for |timechart wich will omit the not-full first and last buckets from the result. In our example case you'd get only four buckets - 10:31-10:32, 10:32-10:33, 10:33-10:34 and 10:34-10:35.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 11:11:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Single-value-panel-with-trend-based-on-avg-count/m-p/565463#M197024</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-09-01T11:11:20Z</dc:date>
    </item>
  </channel>
</rss>

