<?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: Showing mean() and avg() side by side in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Showing-mean-and-avg-side-by-side/m-p/570242#M198753</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223081"&gt;@Gunnar&lt;/a&gt;&amp;nbsp;Try this once:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats avg(Capacity) as Avg_Capacity
| stats mean(Capacity) as Mean_Capacity
| table Avg_Capacity Mean_Capacity&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 08 Oct 2021 14:33:18 GMT</pubDate>
    <dc:creator>ashvinpandey</dc:creator>
    <dc:date>2021-10-08T14:33:18Z</dc:date>
    <item>
      <title>Showing mean() and avg() side by side</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Showing-mean-and-avg-side-by-side/m-p/570189#M198733</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;strange thing - when using mean() and avg() in the same stats command, whichever is written first is empty, while the second value&amp;nbsp; is shown with the correct result.&lt;/P&gt;&lt;P&gt;... | stats mean(Capacity) avg(Capacity)&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;mean(Capacity)&lt;/TD&gt;&lt;TD width="50%"&gt;avg(Capacity)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="50%"&gt;20.71428&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... | stats&amp;nbsp; avg(Capacity)&amp;nbsp;mean(Capacity)&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;avg(Capacity)&amp;nbsp;&lt;/TD&gt;&lt;TD width="50%"&gt;mean(Capacity)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="50%"&gt;20.71428&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know they are basically the same values. But why can't I show them side by side?&lt;/P&gt;&lt;P&gt;Each function on its own is working fine.&lt;/P&gt;&lt;P&gt;Also adding any of the other statistical functions is no problem, just avg() and mean() don't go together.&lt;/P&gt;&lt;P&gt;Why?&lt;/P&gt;&lt;P&gt;I'm on 8.2.0 at the moment.&lt;/P&gt;&lt;P&gt;Thank you very much and kind regards,&lt;/P&gt;&lt;P&gt;Gunnar&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 09:56:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Showing-mean-and-avg-side-by-side/m-p/570189#M198733</guid>
      <dc:creator>Gunnar</dc:creator>
      <dc:date>2021-10-08T09:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Showing mean() and avg() side by side</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Showing-mean-and-avg-side-by-side/m-p/570190#M198734</link>
      <description>&lt;P&gt;For testing:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="Date,Name,Capacity
 2020-01-01,VM1,5
 2020-01-02,VM2,5
 2020-01-03,VM4,5
 2020-01-04,VM1,10
 2020-01-05,VM2,10
 2020-01-06,VM4,10
 2020-01-07,VM1,10
 2020-01-08,VM2,10
 2020-01-09,VM1,15
 2020-01-10,VM2,15
 2020-01-11,VM1,15
 2020-01-12,VM2,15
 2020-01-13,VM1,15
 2020-01-14,VM2,20
 2020-01-15,VM3,20
 2020-01-16,VM1,20
 2020-01-17,VM2,25
 2020-01-18,VM3,25
 2020-01-19,VM3,50
 2020-01-20,VM3,55
 2020-01-21,VM3,80 "
 | multikv forceheader=1
 | eval _time=strptime(Date, "%Y-%m-%d")
 | fields Capacity
 | stats list(Capacity) min(Capacity) max(Capacity) avg(Capacity) median(Capacity) range(Capacity) mean(Capacity) stdev(Capacity) var(Capacity)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 10:02:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Showing-mean-and-avg-side-by-side/m-p/570190#M198734</guid>
      <dc:creator>Gunnar</dc:creator>
      <dc:date>2021-10-08T10:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Showing mean() and avg() side by side</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Showing-mean-and-avg-side-by-side/m-p/570232#M198745</link>
      <description>&lt;P&gt;From the job log:&lt;/P&gt;&lt;PRE&gt;10-08-2021 16:03:36.510 INFO  StatsProcessorV2 [10773 searchOrchestrator] - StatsProcessorV2::processArguments: Unaligned accesses are free
10-08-2021 16:03:36.510 INFO  StatsAggregations [10773 searchOrchestrator] - Instantiating Stats function list for key=Capacity, alias=list(Capacity)
10-08-2021 16:03:36.510 INFO  StatsAggregations [10773 searchOrchestrator] - Instantiating Stats function min for key=Capacity, alias=min(Capacity)
10-08-2021 16:03:36.510 INFO  StatsAggregations [10773 searchOrchestrator] - Instantiating Stats function max for key=Capacity, alias=max(Capacity)
10-08-2021 16:03:36.510 INFO  StatsAggregations [10773 searchOrchestrator] - Instantiating Stats function mean for key=Capacity, alias=avg(Capacity)
10-08-2021 16:03:36.510 INFO  StatsAggregations [10773 searchOrchestrator] - Instantiating Stats function median for key=Capacity, alias=median(Capacity)
10-08-2021 16:03:36.510 INFO  StatsAggregations [10773 searchOrchestrator] - Instantiating Stats function range for key=Capacity, alias=range(Capacity)
10-08-2021 16:03:36.510 INFO  StatsAggregations [10773 searchOrchestrator] - Found existing Stats function  mean for key=Capacity alias changed to mean(Capacity)
10-08-2021 16:03:36.510 INFO  StatsAggregations [10773 searchOrchestrator] - Instantiating Stats function stdev for key=Capacity, alias=stdev(Capacity)
10-08-2021 16:03:36.510 INFO  StatsAggregations [10773 searchOrchestrator] - Instantiating Stats function var for key=Capacity, alias=var(Capacity)&lt;/PRE&gt;&lt;P&gt;See the 3rd line from the bottom. Apparently Splunk notices that those two functions are equivalent to each other and decides it won't calculate values twice. Why it doesn't display the resulting value anyway beats me.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 14:07:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Showing-mean-and-avg-side-by-side/m-p/570232#M198745</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-10-08T14:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Showing mean() and avg() side by side</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Showing-mean-and-avg-side-by-side/m-p/570236#M198748</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223081"&gt;@Gunnar&lt;/a&gt;&amp;nbsp;Try using the below one:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats avg(Capacity) as Avg_Capacity mean(Capacity) as Mean_Capacity&lt;/LI-CODE&gt;&lt;P&gt;OR&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| chart avg(Capacity) as Avg_Capacity mean(Capacity) as Mean_Capacity&lt;/LI-CODE&gt;&lt;P&gt;Also, If this reply helps you, a thumbs-up would be appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 14:15:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Showing-mean-and-avg-side-by-side/m-p/570236#M198748</guid>
      <dc:creator>ashvinpandey</dc:creator>
      <dc:date>2021-10-08T14:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Showing mean() and avg() side by side</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Showing-mean-and-avg-side-by-side/m-p/570240#M198751</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;first option doesn't make a difference - same result.&lt;/P&gt;&lt;P&gt;Using chart doesn't work either but returns an interesting error message:&lt;/P&gt;&lt;P&gt;"Error in 'chart' command: The specifier 'mean(Capacity)' is specified multiple times"&lt;/P&gt;&lt;P&gt;Which goes back to the reply from&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;and what the log shows - apparently Splunk sees avg() and mean() as the same function and computes it only once in the same command.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Gunnar&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 14:28:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Showing-mean-and-avg-side-by-side/m-p/570240#M198751</guid>
      <dc:creator>Gunnar</dc:creator>
      <dc:date>2021-10-08T14:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Showing mean() and avg() side by side</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Showing-mean-and-avg-side-by-side/m-p/570241#M198752</link>
      <description>&lt;P&gt;Thanks for looking at the logs.&lt;/P&gt;&lt;P&gt;So there actually is no separate avg() function - its just a fallback to mean().&lt;/P&gt;&lt;P&gt;That's not what I expected but probably explains it.&lt;/P&gt;&lt;P&gt;BR!&lt;/P&gt;&lt;P&gt;Gunnar&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 14:32:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Showing-mean-and-avg-side-by-side/m-p/570241#M198752</guid>
      <dc:creator>Gunnar</dc:creator>
      <dc:date>2021-10-08T14:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Showing mean() and avg() side by side</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Showing-mean-and-avg-side-by-side/m-p/570242#M198753</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223081"&gt;@Gunnar&lt;/a&gt;&amp;nbsp;Try this once:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats avg(Capacity) as Avg_Capacity
| stats mean(Capacity) as Mean_Capacity
| table Avg_Capacity Mean_Capacity&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 08 Oct 2021 14:33:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Showing-mean-and-avg-side-by-side/m-p/570242#M198753</guid>
      <dc:creator>ashvinpandey</dc:creator>
      <dc:date>2021-10-08T14:33:18Z</dc:date>
    </item>
  </channel>
</rss>

