# Watcher to Index

**URL:** <https://discuss.elastic.co/t/watcher-to-index/44669>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [March 17, 2016, 8:25am UTC](https://discuss.elastic.co/t/watcher-to-index/44669 "2016-03-17T08:25:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [March 17, 2016, 8:25am UTC](https://discuss.elastic.co/t/watcher-to-index/44669/1 "2016-03-17T08:25:39Z")

</div>

Watcher keep adding records to the index even when there is no change to the data.

---

<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:** [March 17, 2016, 12:43pm UTC](https://discuss.elastic.co/t/watcher-to-index/44669/2 "2016-03-17T12:43:56Z")

</div>

Hey,

please, if you have a question, take some time to actually explain the problem, so others can follow easily. I can just guess what your question is and will maybe answer something completely different. Take your time to read our advice how to make sure, that a forum post is written in a way that [others can help you](https://www.elastic.co/help). A one sentence problem description will rarely lead to a perfect solution.

My guess here is, you are talking about the `watch_history` index or the `watch` index. In both cases both indices are updated after a watch is run with some information, allowing you to check if the watch was executed and what its state was.

If have no idea what you are refering to with `change to the data` here, so please elaborate.

Thanks,

--Alex

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [March 18, 2016, 1:04am UTC](https://discuss.elastic.co/t/watcher-to-index/44669/3 "2016-03-18T01:04:01Z")

</div>

To further elaborate on the problem. I have 3 months worth of firewall logs in the elasticsearch and I have set up a watcher to look at the indices of the the 3 months to create a copy of the log entry in an index if a word like attack exist in the log entry. After starting the watcher I noticed that with no new log entries coming in my index which watcher writes to keeps increase in records. How can I avoid this since I need the log entries with words like "attack" to appear only once in the index written to by watcher

---

<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:** [March 21, 2016, 7:41am UTC](https://discuss.elastic.co/t/watcher-to-index/44669/4 "2016-03-21T07:41:04Z")

</div>

Hey,

it sounds as if your watch query does not include a timestamp to filter only for recently added events. If you add such a filter, you could ensure only new entries are matched by the watch.

--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 6, 2017, 1:46pm UTC](https://discuss.elastic.co/t/watcher-to-index/44669/5 "2017-07-06T13:46:11Z")

</div>


