# Illegal\_argument\_exception | Elasticsearch

**URL:** <https://discuss.elastic.co/t/illegal-argument-exception-elasticsearch/196648>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [August 25, 2019, 7:19am UTC](https://discuss.elastic.co/t/illegal-argument-exception-elasticsearch/196648 "2019-08-25T07:19:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ntran](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@ntran](https://discuss.elastic.co/u/ntran)\
**Post date:** [August 25, 2019, 7:19am UTC](https://discuss.elastic.co/t/illegal-argument-exception-elasticsearch/196648/1 "2019-08-25T07:19:37Z")

</div>

Hi,

I am getting an illegal argument exception, however when I look at the output, the aggregated field and names are correct.  
Could anyone please help me?

// Output

> <https://gist.github.com/nhtrn/133e926908f3ffbb3ad8b91aa23d7e5a>

---

<div class="post-metadata">

**Author:** ![ntran](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@ntran](https://discuss.elastic.co/u/ntran)\
**Post date:** [August 25, 2019, 7:47am UTC](https://discuss.elastic.co/t/illegal-argument-exception-elasticsearch/196648/2 "2019-08-25T07:47:34Z")

</div>

Hi all,

Found the issue.

It is `ctx.payload.hits.total`, not `ctx.payload.hits.total.value`

---

<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:** [September 22, 2019, 7:47am UTC](https://discuss.elastic.co/t/illegal-argument-exception-elasticsearch/196648/3 "2019-09-22T07:47:38Z")

</div>

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