# Logstash multiline codec ignores last line of log file

**URL:** https://discuss.elastic.co/t/logstash-multiline-codec-ignores-last-line-of-log-file/281318
**Category:** Logstash
**Created:** [August 13, 2021, 8:19am UTC](https://discuss.elastic.co/t/logstash-multiline-codec-ignores-last-line-of-log-file/281318 "2021-08-13T08:19:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![san2597](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/san2597/32/89746_2.png) [@san2597](https://discuss.elastic.co/u/san2597)
#### Post date: [August 13, 2021, 8:19am UTC](https://discuss.elastic.co/t/logstash-multiline-codec-ignores-last-line-of-log-file/281318/1 "2021-08-13T08:19:51Z")

</div>

My logstash config has a mix of multiline and single line events that are being parsed correctly, reading a log file. I'm using multiline codec as follows:

```auto
input {
    file {
    .....
    .....
    codec => multiline {
        pattern => ......
        what => "previous"
        }
    }
}

filter {
    ......
}

output {
    file {
    codec => json_lines {}
    }
}

```

However, I also need to parse the line at the end of log file starting with 'Thank you for using said app.' But due to multiline codec, Logstash does not parse the last line of the log file. How can i correct this? I cannot modify the log file generator to add a delimiter (\n) when ending the log file.

---

<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: [September 10, 2021, 8:20am UTC](https://discuss.elastic.co/t/logstash-multiline-codec-ignores-last-line-of-log-file/281318/2 "2021-09-10T08:20:46Z")

</div>

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