logstash-plugins / logstash-input-file

Apache License 2.0
68 stars 101 forks source link

handle EOF when checking archive validity #321

Closed jsvd closed 11 months ago

jsvd commented 11 months ago

if the gzip file is truncated the EOF exception must be handled during archive validity check.

To test, create a truncated gzip file:

/tmp ❯ echo "1234567890" | gzip > a.gz
/tmp ❯ dd if=a.gz of=a.truncated.gz bs=1 count=5
5+0 records in
5+0 records out
5 bytes transferred in 0.000263 secs (19011 bytes/sec)

Then start Logstash:

bin/logstash -e "input { file { path => '/tmp/a.truncated.gz' sincedb_path => '/dev/null' mode => read check_archive_validity => true start_position => 'beginning' file_completed_action => log file_completed_log_path => '/tmp/log' } } "

closes https://github.com/logstash-plugins/logstash-input-file/issues/300

jsvd commented 11 months ago

@logstashmachine bump patch