# Renaming key & doc\_count in bucket aggregations

**URL:** <https://discuss.elastic.co/t/renaming-key-doc-count-in-bucket-aggregations/88391>\
**Category:** Elasticsearch\
**Created:** [June 6, 2017, 10:02am UTC](https://discuss.elastic.co/t/renaming-key-doc-count-in-bucket-aggregations/88391 "2017-06-06T10:02:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gianni\_Livolsi](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@Gianni\_Livolsi](https://discuss.elastic.co/u/Gianni_Livolsi)\
**Post date:** [June 6, 2017, 10:02am UTC](https://discuss.elastic.co/t/renaming-key-doc-count-in-bucket-aggregations/88391/1 "2017-06-06T10:02:57Z")

</div>

In a bucket aggregations i get the following result result, is it possible rename the result labels..??

Example key renamed in LABEL and doc\_count renamed in VALUE.

```
{
  "took": 4,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 26022,
    "max_score": 0,
    "hits": []
  },
  "aggregations": {
    "mio": {
      "doc_count_error_upper_bound": 0,
      "sum_other_doc_count": 0,
      "buckets": [
        {
          "key": "CITROEN",
          "doc_count": 23854
        },
        {
          "key": "BMW",
          "doc_count": 2120
        },
        {
          "key": "AUDI",
          "doc_count": 32
        }
      ]
    }
  }
}
```

---

<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 4, 2017, 10:03am UTC](https://discuss.elastic.co/t/renaming-key-doc-count-in-bucket-aggregations/88391/2 "2017-07-04T10:03:09Z")

</div>

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