# Group by option with Basic License in Elasticsearch 7.2

**URL:** <https://discuss.elastic.co/t/group-by-option-with-basic-license-in-elasticsearch-7-2/206607>\
**Category:** Elasticsearch\
**Created:** [November 5, 2019, 12:23pm UTC](https://discuss.elastic.co/t/group-by-option-with-basic-license-in-elasticsearch-7-2/206607 "2019-11-05T12:23:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![skdasari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/skdasari/32/50452_2.png) [@skdasari](https://discuss.elastic.co/u/skdasari)\
**Post date:** [November 5, 2019, 12:23pm UTC](https://discuss.elastic.co/t/group-by-option-with-basic-license-in-elasticsearch-7-2/206607/1 "2019-11-05T12:23:10Z")

</div>

Hello All,

License Type: Basic license.  
Version : Elasticsearch 7.2.1  
Problem: Unable to perform Group by search  
Description: I am trying to generate a report for max\_cpu utilized for all servers for a day. Is it possible to perform group by as below not getting different servers, Rather getting records with only one server.

GET /metricbeat-7.2.1-2019.10.18-000003/\_search  
{  
"aggs": { "group\_by\_hostname": { "terms": { "field": "host.name" } } }  
}

---

<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:** [November 6, 2019, 9:28am UTC](https://discuss.elastic.co/t/group-by-option-with-basic-license-in-elasticsearch-7-2/206607/2 "2019-11-06T09:28:25Z")

</div>

if you want to create an aggregation that returns the maximum CPU usage for each host, you need to start to nest a max aggregation within the terms aggregation.

Also, you are only querying a single index, but for that day there might be more indices, so you should probably query all indices from that day, maybe then there are also more servers in your response?

---

<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:** [December 4, 2019, 9:28am UTC](https://discuss.elastic.co/t/group-by-option-with-basic-license-in-elasticsearch-7-2/206607/3 "2019-12-04T09:28:35Z")

</div>

Closed on December 4, 2019, 9:28am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
