# Get values from bucket specifying key value

**URL:** <https://discuss.elastic.co/t/get-values-from-bucket-specifying-key-value/157111>\
**Category:** Elasticsearch\
**Created:** [November 16, 2018, 5:11pm UTC](https://discuss.elastic.co/t/get-values-from-bucket-specifying-key-value/157111 "2018-11-16T17:11:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdavi](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@mdavi](https://discuss.elastic.co/u/mdavi)\
**Post date:** [November 16, 2018, 5:11pm UTC](https://discuss.elastic.co/t/get-values-from-bucket-specifying-key-value/157111/1 "2018-11-16T17:11:44Z")

</div>

Dears all,

I'm trying to get the value inside my bucket-aggregation specifying the value of the key, but without success...

Now I'm using this way to retrieve all information

```
 {{#payload.aggregations.Applications.buckets}} - APPLICATION NAME: {{key}} (TOTAL: {{doc_count}} ) \t {{/payload.aggregations.Applications.buckets}}

```

Is there a way to specify the {{key}} and get the value??  
Something like that:

```
 Application1: {{payload.aggregations.Applications.buckets.key['Application1'].doc_count}}

```

Thanks in advance.

---

<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 14, 2018, 5:11pm UTC](https://discuss.elastic.co/t/get-values-from-bucket-specifying-key-value/157111/2 "2018-12-14T17:11:45Z")

</div>

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