# Aggregate filter usage

**URL:** <https://discuss.elastic.co/t/aggregate-filter-usage/215744>\
**Category:** Logstash\
**Created:** [January 20, 2020, 1:45pm UTC](https://discuss.elastic.co/t/aggregate-filter-usage/215744 "2020-01-20T13:45:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhilsharma.in](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@akhilsharma.in](https://discuss.elastic.co/u/akhilsharma.in)\
**Post date:** [January 20, 2020, 1:45pm UTC](https://discuss.elastic.co/t/aggregate-filter-usage/215744/1 "2020-01-20T13:45:32Z")

</div>

Hi Team,

I want to write filter to compare current event with previous one. My requirement is as below:

Let's say first log has event id as 100, I want to check when the second log comes it should be 1 greater than previous one. That is, it should be 101. If it's not 101, then I wan't to add tag to the event.

Please help out. I have never used aggregate filter.

Thanks  
Akhil Sharma

---

<div class="post-metadata">

**Author:** ![grumo35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grumo35/32/59451_2.png) [@grumo35](https://discuss.elastic.co/u/grumo35)\
**Post date:** [January 20, 2020, 2:05pm UTC](https://discuss.elastic.co/t/aggregate-filter-usage/215744/2 "2020-01-20T14:05:46Z")

</div>

You should try to look for watcher rules instead of Aggregate filter plugin which dosen't seem to be useful in your use case.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [January 20, 2020, 3:10pm UTC](https://discuss.elastic.co/t/aggregate-filter-usage/215744/3 "2020-01-20T15:10:44Z")

</div>

logstash generally does not preserve the order of events.

---

<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:** [February 17, 2020, 3:22pm UTC](https://discuss.elastic.co/t/aggregate-filter-usage/215744/4 "2020-02-17T15:22:30Z")

</div>

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