# Aggregation count for email Body

**URL:** https://discuss.elastic.co/t/aggregation-count-for-email-body/137675
**Category:** Elasticsearch
**Tags:** elastic-stack-alerting
**Created:** [June 27, 2018, 6:09pm UTC](https://discuss.elastic.co/t/aggregation-count-for-email-body/137675 "2018-06-27T18:09:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rajumkc](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@rajumkc](https://discuss.elastic.co/u/rajumkc)
#### Post date: [June 27, 2018, 6:09pm UTC](https://discuss.elastic.co/t/aggregation-count-for-email-body/137675/1 "2018-06-27T18:09:10Z")

</div>

Hello:

I've an Aggregation Response in the below format, and would like to report on {{ctx.payload.aggregations.errors.buckets.COM.errorDetails.errorDetails.doc\_count}}.

Aggregation Response:

aggregations": {  
"errors": {  
"buckets": {  
"COM": {  
"doc\_count": 64,  
"errorDetails.errorDetails": {  
"doc\_count": 104,  
"by\_code": {  
"doc\_count\_error\_upper\_bound": 0,  
"sum\_other\_doc\_count": 0,  
"buckets": [  
{  
"key": "1001",  
"doc\_count": 64  
},  
{  
"key": "1002",  
"doc\_count": 40  
}  
]  
}  
}  
},

The goal is to have the count information in the email Body.  
I don't see any output for {{ctx.payload.aggregations.errors.buckets.COM.errorDetails.errorDetails.doc\_count}} in the Body of the send\_Email action (expected is 104).

Please advice. Thanks!

---

<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 29, 2018, 12:49pm UTC](https://discuss.elastic.co/t/aggregation-count-for-email-body/137675/2 "2018-06-29T12:49:26Z")

</div>

Hey,

please take the time to properly format your messages, this makes it much easier to read, and also to copy/paste.

Try to remove the `.` form your bucket name. Use `errorDetails` instead of `errorDetails.errorDetails`.

--Alex

---

<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 27, 2018, 12:49pm UTC](https://discuss.elastic.co/t/aggregation-count-for-email-body/137675/3 "2018-07-27T12:49:30Z")

</div>

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