# \[SOLVED\] Auto\_flush\_interval not flushing on UDP input

**URL:** <https://discuss.elastic.co/t/solved-auto-flush-interval-not-flushing-on-udp-input/60387>\
**Category:** Logstash\
**Created:** [September 13, 2016, 2:23pm UTC](https://discuss.elastic.co/t/solved-auto-flush-interval-not-flushing-on-udp-input/60387 "2016-09-13T14:23:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raul\_Uria](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@Raul\_Uria](https://discuss.elastic.co/u/Raul_Uria)\
**Post date:** [September 13, 2016, 2:23pm UTC](https://discuss.elastic.co/t/solved-auto-flush-interval-not-flushing-on-udp-input/60387/1 "2016-09-13T14:23:48Z")

</div>

Hi, I´m having problem with multiline codec, my last event is not processed until new one came along.

I know it sounds like I need to configure auto\_flush\_interval to get rid of the last event, but I set auto\_flush\_interval to 1 and nothing happens.

Using logstash logstash-codec-multiline (2.0.11) & logstash v.2.3.2.

here my input:

```
udp {
	host => '0.0.0.0'
	port => '33445'
	codec => multiline {
	  charset => "UTF-8"
	  pattern => "^\t"
	  negate => false
	  what => "previous"
	  auto_flush_interval => 1
	}

```

thx.

---

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [September 19, 2016, 9:27am UTC](https://discuss.elastic.co/t/solved-auto-flush-interval-not-flushing-on-udp-input/60387/2 "2016-09-19T09:27:37Z")

</div>

No - multiline auto-flush does not work with the UDP input yet. AFAIK the file input and the beats input are the only input plugins that have been modified to support auto-flush.

It is not possible make auto-flushing work in the codec alone without modifying the input code as well.

The reason why the multiline (or any) codec can't support auto-flush without the input being modified is because the codecs are in-band event generators. This means that the call to decode happens in the input thread's execution context. The input thread calls the codec's decode method with a closure to call back on. Auto-flush is something that occurs out-of-band i.e. in another thread at some time later when the input thread is doing some other work - the auto-flush code/thread does not have a reference to the input to call back on when it has an auto-flush generated event give to Logstash for further processing.

---

<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, 4:38am UTC](https://discuss.elastic.co/t/solved-auto-flush-interval-not-flushing-on-udp-input/60387/3 "2017-07-06T04:38:02Z")

</div>


