# How to get ctx.payload.\_value size and apply condition on that

**URL:** <https://discuss.elastic.co/t/how-to-get-ctx-payload-value-size-and-apply-condition-on-that/315104>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [September 25, 2022, 4:57pm UTC](https://discuss.elastic.co/t/how-to-get-ctx-payload-value-size-and-apply-condition-on-that/315104 "2022-09-25T16:57:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhand\_1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akhand_1/32/111231_2.png) [@akhand\_1](https://discuss.elastic.co/u/akhand_1)\
**Post date:** [September 25, 2022, 4:57pm UTC](https://discuss.elastic.co/t/how-to-get-ctx-payload-value-size-and-apply-condition-on-that/315104/1 "2022-09-25T16:57:54Z")

</div>

Hi team, @leandrojmp @stephenb @Badger

I want to implement condition such that if the value to ctx.payload.\_value exceeds a certain number then only alerts need to be sent by watchers.

Please suggest on this.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [September 25, 2022, 6:23pm UTC](https://discuss.elastic.co/t/how-to-get-ctx-payload-value-size-and-apply-condition-on-that/315104/2 "2022-09-25T18:23:17Z")

</div>

Hi @akhand_1 Welcome to the community!

> [@akhand\_1](#):
>
> @leandrojmp @stephenb @Badger

but please do not directly `@` mention people in a thread that have not joined the thread, it is really not best practice.. we are all just volunteers... and for example some people may not have expertise in the topic.

Please be patient...

I would also suggest providing your entire watcher code if you want help.

---

<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:** [October 23, 2022, 6:23pm UTC](https://discuss.elastic.co/t/how-to-get-ctx-payload-value-size-and-apply-condition-on-that/315104/3 "2022-10-23T18:23:46Z")

</div>

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