logstash-plugins / logstash-input-http_poller

Create Logstash events by polling HTTP endpoints!
https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http_poller.html
Apache License 2.0
43 stars 65 forks source link

support line-style codecs by ensuring flush is sent with each response #97

Closed yaauie closed 6 years ago

yaauie commented 6 years ago

User sabdoul in the Logstash Forums reported that the last line of responses read with the line codec were not getting flushed:

I have my last line of csv data that I get with http_poller plugin that is not imported. Some people have solved the problem by adding a blank newline at the end of the csv file. [...]

-- https://discuss.elastic.co/t/logstash-filter-csv-last-row-not-reading/128005

This patch ensures that the codec is flushed at the end of each body.

An alternate approach, which would still require flushing, would be to clone the codec for each response, since responses shouldn't interleave on the codec anyway.