logstash-input-file 4.4.4 → 4.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/filewatch/read_mode/handlers/read_zip_file.rb +2 -2
- data/lib/jars/filewatch-1.0.1.jar +0 -0
- data/logstash-input-file.gemspec +1 -1
- data/spec/helpers/spec_helper.rb +6 -0
- data/spec/inputs/file_read_spec.rb +31 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 063f72c89ee45f05e386433cc55b797597ceed3fbda22f37dc1034275e8e9530
|
4
|
+
data.tar.gz: fe76691a8f46897b716aa9dca6a9420896e619d85f1ca1e12181e1b6f0f5765a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9416e24b57cc632d9182fee5d082f6ca58a31da78f97f013fb07af4b877d341508911a8eb418ef782493c0146f9f04a6477471ab5fa180f3398667426b37e098
|
7
|
+
data.tar.gz: bdda74f5fd273e5fee2ab9b15bda33491cc6c8afded19b501df97afffcbb14623c698a109d466d430119d88c04be4649a51892fb5a8f9e09f0ad395ec64d64a4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 4.4.5
|
2
|
+
- Handle EOF when checking archive validity [#321](https://github.com/logstash-plugins/logstash-input-file/pull/321)
|
3
|
+
|
1
4
|
## 4.4.4
|
2
5
|
- Fixes gzip file handling in read mode when run on JDK12+, including JDK17 that is bundled with Logstash 8.4+ [#312](https://github.com/logstash-plugins/logstash-input-file/pull/312)
|
3
6
|
|
@@ -71,14 +71,14 @@ module FileWatch module ReadMode module Handlers
|
|
71
71
|
|
72
72
|
def corrupted?(watched_file)
|
73
73
|
begin
|
74
|
+
start = Time.new
|
74
75
|
file_stream = FileInputStream.new(watched_file.path)
|
75
76
|
gzip_stream = GZIPInputStream.new(file_stream)
|
76
77
|
buffer = Java::byte[8192].new
|
77
|
-
start = Time.new
|
78
78
|
until gzip_stream.read(buffer) == -1
|
79
79
|
end
|
80
80
|
return false
|
81
|
-
rescue ZipException => e
|
81
|
+
rescue ZipException, Java::JavaIo::EOFException => e
|
82
82
|
duration = Time.now - start
|
83
83
|
logger.warn("Detected corrupted archive #{watched_file.path} file won't be processed", :message => e.message,
|
84
84
|
:duration => duration.round(3))
|
Binary file
|
data/logstash-input-file.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-input-file'
|
4
|
-
s.version = '4.4.
|
4
|
+
s.version = '4.4.5'
|
5
5
|
s.licenses = ['Apache-2.0']
|
6
6
|
s.summary = "Streams events from files"
|
7
7
|
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"
|
data/spec/helpers/spec_helper.rb
CHANGED
@@ -245,6 +245,37 @@ describe LogStash::Inputs::File do
|
|
245
245
|
expect(IO.read(log_completed_path)).to be_empty
|
246
246
|
end
|
247
247
|
end
|
248
|
+
|
249
|
+
it "the truncated file is untouched" do
|
250
|
+
directory = Stud::Temporary.directory
|
251
|
+
file_path = fixture_dir.join('compressed.log.gz')
|
252
|
+
truncated_file_path = ::File.join(directory, 'truncated.gz')
|
253
|
+
FileUtils.cp(file_path, truncated_file_path)
|
254
|
+
|
255
|
+
FileInput.truncate_gzip(truncated_file_path)
|
256
|
+
|
257
|
+
log_completed_path = ::File.join(directory, "C_completed.txt")
|
258
|
+
f = File.new(log_completed_path, "w")
|
259
|
+
f.close()
|
260
|
+
|
261
|
+
conf = <<-CONFIG
|
262
|
+
input {
|
263
|
+
file {
|
264
|
+
type => "blah"
|
265
|
+
path => "#{truncated_file_path}"
|
266
|
+
mode => "read"
|
267
|
+
file_completed_action => "log_and_delete"
|
268
|
+
file_completed_log_path => "#{log_completed_path}"
|
269
|
+
check_archive_validity => true
|
270
|
+
}
|
271
|
+
}
|
272
|
+
CONFIG
|
273
|
+
|
274
|
+
events = input(conf) do |pipeline, queue|
|
275
|
+
wait(1)
|
276
|
+
expect(IO.read(log_completed_path)).to be_empty
|
277
|
+
end
|
278
|
+
end
|
248
279
|
end
|
249
280
|
end
|
250
281
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-file
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.4.
|
4
|
+
version: 4.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -282,7 +282,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
282
282
|
- !ruby/object:Gem::Version
|
283
283
|
version: '0'
|
284
284
|
requirements: []
|
285
|
-
rubygems_version: 3.
|
285
|
+
rubygems_version: 3.2.33
|
286
286
|
signing_key:
|
287
287
|
specification_version: 4
|
288
288
|
summary: Streams events from files
|