# Logstash plugin flush interval

**URL:** https://discuss.elastic.co/t/logstash-plugin-flush-interval/25654
**Category:** Logstash
**Created:** [July 15, 2015, 5:13pm UTC](https://discuss.elastic.co/t/logstash-plugin-flush-interval/25654 "2015-07-15T17:13:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![karthikbox](https://avatars.discourse-cdn.com/v4/letter/k/0ea827/32.png) [@karthikbox](https://discuss.elastic.co/u/karthikbox)
#### Post date: [July 15, 2015, 5:13pm UTC](https://discuss.elastic.co/t/logstash-plugin-flush-interval/25654/1 "2015-07-15T17:13:00Z")

</div>

Hi all,

I've been writing a custom filter plugin for logstash.  
I have a cleanup method which needs to be called periodically (lets say 3 sec).  
I understand that this is achievable by overriding "flush" method in my plugin. How often will this method be called by LogStash? Is this time interval configurable? Any help would be appreciated.

Thanks.

---

<div class="post-metadata">

### Author: ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)
#### Post date: [July 28, 2015, 6:07pm UTC](https://discuss.elastic.co/t/logstash-plugin-flush-interval/25654/2 "2015-07-28T18:07:24Z")

</div>

Hello, yes if you are overriding the flush method the pipeline will call it every 5 second.  
You can see the related code at [https://github.com/ph/logstash/blob/master/lib/logstash/pipeline.rb#L160](https://github.com/ph/logstash/blob/master/lib/logstash/pipeline.rb#L160)

Sadly the `time` is not configurable, if you need more granular settings you should implement this logic inside your filters.

---

<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:33am UTC](https://discuss.elastic.co/t/logstash-plugin-flush-interval/25654/3 "2017-07-06T05:33:34Z")

</div>


