# Watcher: alert when new value seen

**URL:** <https://discuss.elastic.co/t/watcher-alert-when-new-value-seen/201302>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [September 26, 2019, 7:01pm UTC](https://discuss.elastic.co/t/watcher-alert-when-new-value-seen/201302 "2019-09-26T19:01:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jusmitch](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@jusmitch](https://discuss.elastic.co/u/jusmitch)\
**Post date:** [September 26, 2019, 7:01pm UTC](https://discuss.elastic.co/t/watcher-alert-when-new-value-seen/201302/1 "2019-09-26T19:01:13Z")

</div>

There's an elastalert feature that I currently depend on, and I'm curious if there's a way to do it with Watcher. Elastalert can alert when a new value has been seen. For instance, it could alert when a new IP address shows up in netflow.src\_address. Any ideas on how to do this?

Thanks,  
Justin

---

<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:** [September 30, 2019, 11:59am UTC](https://discuss.elastic.co/t/watcher-alert-when-new-value-seen/201302/2 "2019-09-30T11:59:10Z")

</div>

Hey,

a possible solution to this problem is to search for all documents from now-$YOUR\_INTERVAL\*2 (eg `5m`), so `now-10m` and then create a `filters` aggregation and specify two buckets, `now-5m` and from -5m till -10m. Then have a terms aggregation on the `src_address` and check the results for differences.

Note, that this only works up until a certain limit due to limiting the number of buckets. You may want to take a look at the composite aggregation to support pagination, but this will not work with watcher.

Hope this helps as a start.

--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:** [October 28, 2019, 11:59am UTC](https://discuss.elastic.co/t/watcher-alert-when-new-value-seen/201302/3 "2019-10-28T11:59:40Z")

</div>

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