# Aggregation average value is not coming correct

**URL:** <https://discuss.elastic.co/t/aggregation-average-value-is-not-coming-correct/17924>\
**Category:** Elasticsearch\
**Created:** [June 5, 2014, 10:38am UTC](https://discuss.elastic.co/t/aggregation-average-value-is-not-coming-correct/17924 "2014-06-05T10:38:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bagui](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bagui/32/960_2.png) [@bagui](https://discuss.elastic.co/u/bagui)\
**Post date:** [June 5, 2014, 10:38am UTC](https://discuss.elastic.co/t/aggregation-average-value-is-not-coming-correct/17924/1 "2014-06-05T10:38:49Z")

</div>

Hi,

I'm using the below code to get the average value of cpu\_usage using  
aggregation. When I checked the output of cpu value individually and  
calculate the avg, it is not matching with the aggregation avg value. I'm  
using a boolquery along with rangeFilter here to get the data.

Please help to identify the issue.

_Code :_  
public static SearchResponse searchResultWithAggregation(String es\_index,  
String es\_type, List ipList) {  
logger.debug("inside method searchResultWithAggregation...");  
Client client = ESClientFactory.getInstance();  
logger.debug("got the elasticsearch client connection");

BoolQueryBuilder bqb = QueryBuilders.boolQuery()  
.mustNot(QueryBuilders.termQuery("address", "10.203.238.140"));

Iterator i = ipList.iterator();  
logger.debug("got the ip list as :" + ipList);

while (i.hasNext()) {  
bqb.should(QueryBuilders.termQuery("address", i.next()));  
}

String time = "now-30m";  
FilterBuilder fb = FilterBuilders.rangeFilter("@timestamp").from(time)  
.to("now");

SearchResponse response = client  
.prepareSearch(es\_index)  
.setTypes(es\_type)  
.setQuery(bqb)  
.setPostFilter(fb)  
.addAggregation(  
AggregationBuilders.avg("cpu\_average").field("value"))  
.setSize(100).execute().actionGet();

System.out.println(response.toString());

return response;  
}

_Output :_  
{  
"took" : 31,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 15,  
"max\_score" : 1.7314732,  
"hits" : [ {  
"\_index" : "cpu\_usage\_metrics",  
"\_type" : "cpu\_usage\_metrics",  
"\_id" : "UQ9vquDGTQO8WedjgCcESA",  
"\_score" : 1.7314732, "\_source" :  
{"status":0,"occurrences":1,"value":"1","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:23:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
-s Aricloud.`hostname -s`.cpu\_usage"}  
}, {  
"\_index" : "cpu\_usage\_metrics",  
"\_type" : "cpu\_usage\_metrics",  
"\_id" : "EMT85ZKcS3OuoDmHgcSEjw",  
"\_score" : 1.7314732, "\_source" :  
{"status":0,"occurrences":1,"value":"3","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:25:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
-s Aricloud.`hostname -s`.cpu\_usage"}  
}, {  
"\_index" : "cpu\_usage\_metrics",  
"\_type" : "cpu\_usage\_metrics",  
"\_id" : "0Pf-XKZmTI-wpADuIVToFA",  
"\_score" : 1.7314714, "\_source" :  
{"status":0,"occurrences":1,"value":"3","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:21:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
-s Aricloud.`hostname -s`.cpu\_usage"}  
}, {  
"\_index" : "cpu\_usage\_metrics",  
"\_type" : "cpu\_usage\_metrics",  
"\_id" : "Pdn5h2gGRsK0hL2DKj0ZjA",  
"\_score" : 1.7314714, "\_source" :  
{"status":0,"occurrences":1,"value":"2","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:27:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
-s Aricloud.`hostname -s`.cpu\_usage"}  
}, {  
"\_index" : "cpu\_usage\_metrics",  
"\_type" : "cpu\_usage\_metrics",  
"\_id" : "5\_mloLYMSgKRb\_lnH7pqGQ",  
"\_score" : 1.7314714, "\_source" :  
{"status":0,"occurrences":1,"value":"3","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:33:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
-s Aricloud.`hostname -s`.cpu\_usage"}  
}, {  
"\_index" : "cpu\_usage\_metrics",  
"\_type" : "cpu\_usage\_metrics",  
"\_id" : "xjBgO2cXTH-DIQoNpIRnBA",  
"\_score" : 1.7314714, "\_source" :  
{"status":0,"occurrences":1,"value":"4","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:35:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
-s Aricloud.`hostname -s`.cpu\_usage"}  
}, {  
"\_index" : "cpu\_usage\_metrics",  
"\_type" : "cpu\_usage\_metrics",  
"\_id" : "0sclBpwcRQmfyKklXPJbow",  
"\_score" : 1.7314694, "\_source" :  
{"status":0,"occurrences":1,"value":"3","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:29:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
-s Aricloud.`hostname -s`.cpu\_usage"}  
}, {  
"\_index" : "cpu\_usage\_metrics",  
"\_type" : "cpu\_usage\_metrics",  
"\_id" : "O5CVCkYtRQGxJG3TJWDoNw",  
"\_score" : 1.7314694, "\_source" :  
{"status":0,"occurrences":1,"value":"4","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:39:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
-s Aricloud.`hostname -s`.cpu\_usage"}  
}, {  
"\_index" : "cpu\_usage\_metrics",  
"\_type" : "cpu\_usage\_metrics",  
"\_id" : "bEOcnsrRSS6eBdfn8UlG8w",  
"\_score" : 1.7314694, "\_source" :  
{"status":0,"occurrences":1,"value":"14","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:47:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
-s Aricloud.`hostname -s`.cpu\_usage"}  
}, {  
"\_index" : "cpu\_usage\_metrics",  
"\_type" : "cpu\_usage\_metrics",  
"\_id" : "Wp7kA\_5QRYishSBGqJpNxA",  
"\_score" : 1.7314694, "\_source" :  
{"status":0,"occurrences":1,"value":"18","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:49:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
-s Aricloud.`hostname -s`.cpu\_usage"}  
}, {  
"\_index" : "cpu\_usage\_metrics",  
"\_type" : "cpu\_usage\_metrics",  
"\_id" : "vo6xLh8YRqqznXzwbap9mA",  
"\_score" : 1.7314656, "\_source" :  
{"status":0,"occurrences":1,"value":"3","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:31:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
-s Aricloud.`hostname -s`.cpu\_usage"}  
}, {  
"\_index" : "cpu\_usage\_metrics",  
"\_type" : "cpu\_usage\_metrics",  
"\_id" : "eZ2hacYhRKe\_rsB5QZaJxQ",  
"\_score" : 1.7314656, "\_source" :  
{"status":0,"occurrences":1,"value":"13","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:45:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
-s Aricloud.`hostname -s`.cpu\_usage"}  
}, {  
"\_index" : "cpu\_usage\_metrics",  
"\_type" : "cpu\_usage\_metrics",  
"\_id" : "UedHm9r8S3CvQAOMzczZsQ",  
"\_score" : 1.7314491, "\_source" :  
{"status":0,"occurrences":1,"value":"2","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:37:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
-s Aricloud.`hostname -s`.cpu\_usage"}  
}, {  
"\_index" : "cpu\_usage\_metrics",  
"\_type" : "cpu\_usage\_metrics",  
"\_id" : "-Pz6wqikSxqN0HsjCso0tQ",  
"\_score" : 1.7314491, "\_source" :  
{"status":0,"occurrences":1,"value":"3","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:41:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
-s Aricloud.`hostname -s`.cpu\_usage"}  
}, {  
"\_index" : "cpu\_usage\_metrics",  
"\_type" : "cpu\_usage\_metrics",  
"\_id" : "B3pZx-xVQwiuCRJT8pzndQ",  
"\_score" : 1.7314491, "\_source" :  
{"status":0,"occurrences":1,"value":"5","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:43:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
-s Aricloud.`hostname -s`.cpu\_usage"}  
} ]  
},  
"aggregations" : {  
"cpu\_average" : {  
"value" : 41.39343376342633  
}  
}  
}

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/644333cf-8953-4a7f-9367-997b191bf054%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/644333cf-8953-4a7f-9367-997b191bf054%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 16, 2014, 12:32pm UTC](https://discuss.elastic.co/t/aggregation-average-value-is-not-coming-correct/17924/2 "2014-06-16T12:32:17Z")

</div>

Hey,

you are setting a post filter, which means, that the aggregations will work  
without the range filter applied. You may want to use a filtered query and  
move the filter inside the filter part of that particular query.

--Alex

On Thu, Jun 5, 2014 at 12:38 PM, Subhadip Bagui [i.bagui@gmail.com](mailto:i.bagui@gmail.com) wrote:

> Hi,
> 
> I'm using the below code to get the average value of cpu\_usage using  
> aggregation. When I checked the output of cpu value individually and  
> calculate the avg, it is not matching with the aggregation avg value. I'm  
> using a boolquery along with rangeFilter here to get the data.
> 
> Please help to identify the issue.
> 
> _Code :_  
> public static SearchResponse searchResultWithAggregation(String es\_index,  
> String es\_type, List ipList) {  
> logger.debug("inside method searchResultWithAggregation...");  
> Client client = ESClientFactory.getInstance();  
> logger.debug("got the elasticsearch client connection");
> 
> BoolQueryBuilder bqb = QueryBuilders.boolQuery()  
> .mustNot(QueryBuilders.termQuery("address", "10.203.238.140"));
> 
> Iterator i = ipList.iterator();  
> logger.debug("got the ip list as :" + ipList);
> 
> while (i.hasNext()) {  
> bqb.should(QueryBuilders.termQuery("address", i.next()));  
> }
> 
> String time = "now-30m";  
> FilterBuilder fb = FilterBuilders.rangeFilter("@timestamp").from(time)  
> .to("now");
> 
> SearchResponse response = client  
> .prepareSearch(es\_index)  
> .setTypes(es\_type)  
> .setQuery(bqb)  
> .setPostFilter(fb)  
> .addAggregation(  
> AggregationBuilders.avg("cpu\_average").field("value"))  
> .setSize(100).execute().actionGet();
> 
> System.out.println(response.toString());
> 
> return response;  
> }
> 
> _Output :_  
> {  
> "took" : 31,  
> "timed\_out" : false,  
> "\_shards" : {  
> "total" : 5,  
> "successful" : 5,  
> "failed" : 0  
> },  
> "hits" : {  
> "total" : 15,  
> "max\_score" : 1.7314732,  
> "hits" : [ {  
> "\_index" : "cpu\_usage\_metrics",  
> "\_type" : "cpu\_usage\_metrics",  
> "\_id" : "UQ9vquDGTQO8WedjgCcESA",  
> "\_score" : 1.7314732, "\_source" :  
> {"status":0,"occurrences":1,"value":"1","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:23:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
> -s Aricloud.`hostname -s`.cpu\_usage"}  
> }, {  
> "\_index" : "cpu\_usage\_metrics",  
> "\_type" : "cpu\_usage\_metrics",  
> "\_id" : "EMT85ZKcS3OuoDmHgcSEjw",  
> "\_score" : 1.7314732, "\_source" :  
> {"status":0,"occurrences":1,"value":"3","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:25:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
> -s Aricloud.`hostname -s`.cpu\_usage"}  
> }, {  
> "\_index" : "cpu\_usage\_metrics",  
> "\_type" : "cpu\_usage\_metrics",  
> "\_id" : "0Pf-XKZmTI-wpADuIVToFA",  
> "\_score" : 1.7314714, "\_source" :  
> {"status":0,"occurrences":1,"value":"3","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:21:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
> -s Aricloud.`hostname -s`.cpu\_usage"}  
> }, {  
> "\_index" : "cpu\_usage\_metrics",  
> "\_type" : "cpu\_usage\_metrics",  
> "\_id" : "Pdn5h2gGRsK0hL2DKj0ZjA",  
> "\_score" : 1.7314714, "\_source" :  
> {"status":0,"occurrences":1,"value":"2","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:27:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
> -s Aricloud.`hostname -s`.cpu\_usage"}  
> }, {  
> "\_index" : "cpu\_usage\_metrics",  
> "\_type" : "cpu\_usage\_metrics",  
> "\_id" : "5\_mloLYMSgKRb\_lnH7pqGQ",  
> "\_score" : 1.7314714, "\_source" :  
> {"status":0,"occurrences":1,"value":"3","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:33:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
> -s Aricloud.`hostname -s`.cpu\_usage"}  
> }, {  
> "\_index" : "cpu\_usage\_metrics",  
> "\_type" : "cpu\_usage\_metrics",  
> "\_id" : "xjBgO2cXTH-DIQoNpIRnBA",  
> "\_score" : 1.7314714, "\_source" :  
> {"status":0,"occurrences":1,"value":"4","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:35:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
> -s Aricloud.`hostname -s`.cpu\_usage"}  
> }, {  
> "\_index" : "cpu\_usage\_metrics",  
> "\_type" : "cpu\_usage\_metrics",  
> "\_id" : "0sclBpwcRQmfyKklXPJbow",  
> "\_score" : 1.7314694, "\_source" :  
> {"status":0,"occurrences":1,"value":"3","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:29:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
> -s Aricloud.`hostname -s`.cpu\_usage"}  
> }, {  
> "\_index" : "cpu\_usage\_metrics",  
> "\_type" : "cpu\_usage\_metrics",  
> "\_id" : "O5CVCkYtRQGxJG3TJWDoNw",  
> "\_score" : 1.7314694, "\_source" :  
> {"status":0,"occurrences":1,"value":"4","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:39:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
> -s Aricloud.`hostname -s`.cpu\_usage"}  
> }, {  
> "\_index" : "cpu\_usage\_metrics",  
> "\_type" : "cpu\_usage\_metrics",  
> "\_id" : "bEOcnsrRSS6eBdfn8UlG8w",  
> "\_score" : 1.7314694, "\_source" :  
> {"status":0,"occurrences":1,"value":"14","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:47:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
> -s Aricloud.`hostname -s`.cpu\_usage"}  
> }, {  
> "\_index" : "cpu\_usage\_metrics",  
> "\_type" : "cpu\_usage\_metrics",  
> "\_id" : "Wp7kA\_5QRYishSBGqJpNxA",  
> "\_score" : 1.7314694, "\_source" :  
> {"status":0,"occurrences":1,"value":"18","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:49:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
> -s Aricloud.`hostname -s`.cpu\_usage"}  
> }, {  
> "\_index" : "cpu\_usage\_metrics",  
> "\_type" : "cpu\_usage\_metrics",  
> "\_id" : "vo6xLh8YRqqznXzwbap9mA",  
> "\_score" : 1.7314656, "\_source" :  
> {"status":0,"occurrences":1,"value":"3","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:31:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
> -s Aricloud.`hostname -s`.cpu\_usage"}  
> }, {  
> "\_index" : "cpu\_usage\_metrics",  
> "\_type" : "cpu\_usage\_metrics",  
> "\_id" : "eZ2hacYhRKe\_rsB5QZaJxQ",  
> "\_score" : 1.7314656, "\_source" :  
> {"status":0,"occurrences":1,"value":"13","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:45:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
> -s Aricloud.`hostname -s`.cpu\_usage"}  
> }, {  
> "\_index" : "cpu\_usage\_metrics",  
> "\_type" : "cpu\_usage\_metrics",  
> "\_id" : "UedHm9r8S3CvQAOMzczZsQ",  
> "\_score" : 1.7314491, "\_source" :  
> {"status":0,"occurrences":1,"value":"2","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:37:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
> -s Aricloud.`hostname -s`.cpu\_usage"}  
> }, {  
> "\_index" : "cpu\_usage\_metrics",  
> "\_type" : "cpu\_usage\_metrics",  
> "\_id" : "-Pz6wqikSxqN0HsjCso0tQ",  
> "\_score" : 1.7314491, "\_source" :  
> {"status":0,"occurrences":1,"value":"3","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:41:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
> -s Aricloud.`hostname -s`.cpu\_usage"}  
> }, {  
> "\_index" : "cpu\_usage\_metrics",  
> "\_type" : "cpu\_usage\_metrics",  
> "\_id" : "B3pZx-xVQwiuCRJT8pzndQ",  
> "\_score" : 1.7314491, "\_source" :  
> {"status":0,"occurrences":1,"value":"5","key":"Aricloud.vm.cpu\_usage.cpu.usage","client":"vm.server2","@timestamp":"2014-06-05T15:43:13+05:30","check\_name":"cpu\_usage\_metrics","address":"10.203.238.138","command":"cpu-usage-metrics.sh  
> -s Aricloud.`hostname -s`.cpu\_usage"}  
> } ]  
> },  
> "aggregations" : {  
> "cpu\_average" : {  
> "value" : 41.39343376342633  
> }  
> }  
> }
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/644333cf-8953-4a7f-9367-997b191bf054%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/644333cf-8953-4a7f-9367-997b191bf054%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/644333cf-8953-4a7f-9367-997b191bf054%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/644333cf-8953-4a7f-9367-997b191bf054%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM\_R5T4BEO4XPBhmQszALNiyNEBDWPepYcm18ETVHQONNA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM_R5T4BEO4XPBhmQszALNiyNEBDWPepYcm18ETVHQONNA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:22am UTC](https://discuss.elastic.co/t/aggregation-average-value-is-not-coming-correct/17924/3 "2017-07-06T01:22:09Z")

</div>


