# How to drop delayed events beyond a certain threshold?

**URL:** <https://discuss.elastic.co/t/how-to-drop-delayed-events-beyond-a-certain-threshold/43851>\
**Category:** Logstash\
**Created:** [March 9, 2016, 4:08am UTC](https://discuss.elastic.co/t/how-to-drop-delayed-events-beyond-a-certain-threshold/43851 "2016-03-09T04:08:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mallah.rajesh](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mallah.rajesh](https://discuss.elastic.co/u/mallah.rajesh)\
**Post date:** [March 9, 2016, 4:08am UTC](https://discuss.elastic.co/t/how-to-drop-delayed-events-beyond-a-certain-threshold/43851/1 "2016-03-09T04:08:10Z")

</div>

Hi,

I need correct syntax for below pseudo code

filter {  
if [timestamp] \< now - 120 {  
drop {}  
}  
}

i want to drop messages delayed for more than 120secs in certain usage.  
I did search for 2 hrs before posting this message.  
What docs should i have seen to avoid this post ?

Thnaks & Regards for this wonderful software.

Rajesh Mallah.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 9, 2016, 6:47am UTC](https://discuss.elastic.co/t/how-to-drop-delayed-events-beyond-a-certain-threshold/43851/2 "2016-03-09T06:47:55Z")

</div>

You could for example use a ruby filter. [Its documentation](https://www.elastic.co/guide/en/logstash/current/plugins-filters-ruby.html) contains an example that's fairly close to what you want to do.

---

<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, 5:07am UTC](https://discuss.elastic.co/t/how-to-drop-delayed-events-beyond-a-certain-threshold/43851/3 "2017-07-06T05:07:51Z")

</div>


