# Script Condition - Count

**URL:** <https://discuss.elastic.co/t/script-condition-count/196708>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [August 26, 2019, 5:47am UTC](https://discuss.elastic.co/t/script-condition-count/196708 "2019-08-26T05:47:22Z")\
**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 26, 2019, 5:47am UTC](https://discuss.elastic.co/t/script-condition-count/196708/1 "2019-08-26T05:47:22Z")

</div>

Hi all,

I was wondering if it was possible to incorporate `count` in the script condition, instead of the query?

If so, how do you do it?

Thanks in advance,  
Nhung

---

<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:** [August 26, 2019, 8:45am UTC](https://discuss.elastic.co/t/script-condition-count/196708/2 "2019-08-26T08:45:59Z")

</div>

please take the time to properly write up a reproducible example, including a full watch, and the output of the execute watch api - a watch consists of several kilobytes of JSON, the same applies for the response of your outputs, so it is pretty much impossible to find out, what you are referring to.

---

<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 23, 2019, 8:46am UTC](https://discuss.elastic.co/t/script-condition-count/196708/3 "2019-09-23T08:46:00Z")

</div>

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