# Csv file not reading last row from file input

**URL:** <https://discuss.elastic.co/t/csv-file-not-reading-last-row-from-file-input/83452>\
**Category:** Logstash\
**Created:** [April 24, 2017, 6:59pm UTC](https://discuss.elastic.co/t/csv-file-not-reading-last-row-from-file-input/83452 "2017-04-24T18:59:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)\
**Post date:** [April 24, 2017, 6:59pm UTC](https://discuss.elastic.co/t/csv-file-not-reading-last-row-from-file-input/83452/1 "2017-04-24T18:59:16Z")

</div>

Hi All

i am using csv file as input, using file plugin.  
After couple of trials i realized, it is not reading only the last line

Any idea how this can be fixed?

Thanks!

---

<div class="post-metadata">

**Author:** ![Dan](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@Dan](https://discuss.elastic.co/u/Dan)\
**Post date:** [April 25, 2017, 4:46am UTC](https://discuss.elastic.co/t/csv-file-not-reading-last-row-from-file-input/83452/2 "2017-04-25T04:46:03Z")

</div>

Hi Ritesh,

I am also facing same issue you found any solution for this.

---

<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 25, 2017, 5:47am UTC](https://discuss.elastic.co/t/csv-file-not-reading-last-row-from-file-input/83452/3 "2017-04-25T05:47:53Z")

</div>

Does the final line end with a newline character?

---

<div class="post-metadata">

**Author:** ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)\
**Post date:** [April 25, 2017, 8:00am UTC](https://discuss.elastic.co/t/csv-file-not-reading-last-row-from-file-input/83452/4 "2017-04-25T08:00:35Z")

</div>

Final line is not ending up with newline character.

I added a blank row in the bottom of csv and saved the file, re-ran the logstash and it worked.

I think it needs one extra line in bottom.Not sure why it is like this

Thanks!

---

<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 25, 2017, 8:20am UTC](https://discuss.elastic.co/t/csv-file-not-reading-last-row-from-file-input/83452/5 "2017-04-25T08:20:16Z")

</div>

> I think it needs one extra line in bottom.Not sure why it is like this

How would Logstash otherwise know that the line actually ended?

---

<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:** [May 23, 2017, 8:29am UTC](https://discuss.elastic.co/t/csv-file-not-reading-last-row-from-file-input/83452/6 "2017-05-23T08:29:49Z")

</div>

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