# Filebeats missing last line when used with multi line

**URL:** <https://discuss.elastic.co/t/filebeats-missing-last-line-when-used-with-multi-line/47053>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 11, 2016, 10:53pm UTC](https://discuss.elastic.co/t/filebeats-missing-last-line-when-used-with-multi-line/47053 "2016-04-11T22:53:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdaruna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sdaruna/32/7289_2.png) [@sdaruna](https://discuss.elastic.co/u/sdaruna)\
**Post date:** [April 11, 2016, 10:53pm UTC](https://discuss.elastic.co/t/filebeats-missing-last-line-when-used-with-multi-line/47053/1 "2016-04-11T22:53:15Z")

</div>

I have set up filebeat and used multi line pattern to get the full file content as below.  
My requirement is to move whole file content of the file as a single event. I used multiline to achieve it.

multiline:  
pattern: "/.\*./gm"  
negate: true  
match: after  
max\_lines: 20000

If the file has new line at the end, it is taking last line, else, it is ignoring the line.

Please suggest the configuration change, that will take care of this situation.

---

<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:** [April 12, 2016, 5:38am UTC](https://discuss.elastic.co/t/filebeats-missing-last-line-when-used-with-multi-line/47053/2 "2016-04-12T05:38:17Z")

</div>

Filebeat always waits for the end of the line before considering the line complete, even considering the `timeout` option. See below.

> <https://github.com/elastic/beats/issues/1324>

---

<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 5, 2017, 9:53pm UTC](https://discuss.elastic.co/t/filebeats-missing-last-line-when-used-with-multi-line/47053/3 "2017-07-05T21:53:28Z")

</div>


