Skip to content

Commit 94fa3b2

Browse files
committed
Fixed tast nipticks and updated version to 4.1.16
1 parent da99da4 commit 94fa3b2

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

Diff for: CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 4.1.16
2+
- Introduced new `check_archive_validity` settings to enable gzipped files verification, issue [#261](https://github.com/logstash-plugins/logstash-input-file/issues/261)
3+
14
## 4.1.15
25
- Fixed bug in conversion of sincedb_clean_after setting [#257](https://github.com/logstash-plugins/logstash-input-file/pull/257)
36

Diff for: lib/filewatch/read_mode/handlers/read_zip_file.rb

+6-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def handle_specifically(watched_file)
2020
key = watched_file.sincedb_key
2121

2222
if @settings.check_archive_validity && corrupted?(watched_file)
23-
#watched_file.listener.deleted
2423
watched_file.unwatch
2524
else
2625
begin
@@ -38,10 +37,8 @@ def handle_specifically(watched_file)
3837
end
3938
watched_file.listener.eof
4039
rescue ZipException => e
41-
logger.error("Cannot decompress the gzip file at path: #{watched_file.path}", :exception => e,
42-
:class => e.class.name,
43-
:message => e.message,
44-
:backtrace => e.backtrace)
40+
logger.error("Cannot decompress the gzip file at path: #{watched_file.path}", :exception => e.class,
41+
:message => e.message, :backtrace => e.backtrace)
4542
watched_file.listener.error
4643
else
4744
sincedb_collection.store_last_read(key, watched_file.last_stat_size)
@@ -65,7 +62,8 @@ def close_and_ignore_ioexception(closeable)
6562
begin
6663
closeable.close
6764
rescue Exception => e # IOException can be thrown by any of the Java classes that implement the Closable interface.
68-
logger.warn("Ignoring an IOException when closing an instance of #{closeable.class.name}", "exception" => e)
65+
logger.warn("Ignoring an IOException when closing an instance of #{closeable.class.name}",
66+
:exception => e.class, :message => e.message, :backtrace => e.backtrace)
6967
end
7068
end
7169

@@ -80,7 +78,8 @@ def corrupted?(watched_file)
8078
return false
8179
rescue ZipException => e
8280
duration = Time.now - start
83-
logger.warn("#{watched_file.path} is corrupted, #{duration} secs, message: #{e.message}")
81+
logger.warn("Detected corrupted archive #{watched_file.path} file won't be processed", :message => e.message,
82+
:duration => duration.round(3))
8483
return true
8584
ensure
8685
close_and_ignore_ioexception(gzip_stream) unless gzip_stream.nil?

Diff for: logstash-input-file.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |s|
22

33
s.name = 'logstash-input-file'
4-
s.version = '4.1.15'
4+
s.version = '4.1.16'
55
s.licenses = ['Apache-2.0']
66
s.summary = "Streams events from files"
77
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"

0 commit comments

Comments
 (0)