# Multiline Codec: Autoflush causing duplicates of last log message

**URL:** https://discuss.elastic.co/t/multiline-codec-autoflush-causing-duplicates-of-last-log-message/94369
**Category:** Logstash
**Created:** [July 24, 2017, 4:51pm UTC](https://discuss.elastic.co/t/multiline-codec-autoflush-causing-duplicates-of-last-log-message/94369 "2017-07-24T16:51:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![CDR](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@CDR](https://discuss.elastic.co/u/CDR)
#### Post date: [July 24, 2017, 4:51pm UTC](https://discuss.elastic.co/t/multiline-codec-autoflush-causing-duplicates-of-last-log-message/94369/1 "2017-07-24T16:51:11Z")

</div>

So I was having an issue where Logstash's multiline codec was not reading in the last log message from a file. When I added the [auto\_flush\_interval](https://discuss.elastic.co/t/logstash-does-not-read-in-last-line-of-log/2706/15) as suggested in the link. I found that now it adds the log message twice. So it doesn't add the log message when there is no auto flush interval set. And it adds it twice when there is an auto flush interval set. Is there a way to have it only had one event. Again, I am reading the events in from a file and it is not getting added to (i.e. static file)

Thanks!

---

<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: [August 21, 2017, 4:51pm UTC](https://discuss.elastic.co/t/multiline-codec-autoflush-causing-duplicates-of-last-log-message/94369/2 "2017-08-21T16:51:13Z")

</div>

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