logstash-input-file 4.4.3 → 4.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/docs/index.asciidoc +0 -10
- data/lib/filewatch/read_mode/handlers/read_zip_file.rb +3 -3
- 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,9 @@
|
|
1
|
+
## 4.4.5
|
2
|
+
- Handle EOF when checking archive validity [#321](https://github.com/logstash-plugins/logstash-input-file/pull/321)
|
3
|
+
|
4
|
+
## 4.4.4
|
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)
|
6
|
+
|
1
7
|
## 4.4.3
|
2
8
|
- Fixes read mode to restart the read from reference stored in sincedb in case the file wasn't completely consumed. [#307](https://github.com/logstash-plugins/logstash-input-file/pull/307)
|
3
9
|
|
data/docs/index.asciidoc
CHANGED
@@ -9,11 +9,6 @@ START - GENERATED VARIABLES, DO NOT EDIT!
|
|
9
9
|
:release_date: %RELEASE_DATE%
|
10
10
|
:changelog_url: %CHANGELOG_URL%
|
11
11
|
:include_path: ../../../../logstash/docs/include
|
12
|
-
|
13
|
-
ifeval::["{versioned_docs}"=="true"]
|
14
|
-
:branch: %BRANCH%
|
15
|
-
:ecs_version: %ECS_VERSION%
|
16
|
-
endif::[]
|
17
12
|
///////////////////////////////////////////
|
18
13
|
END - GENERATED VARIABLES, DO NOT EDIT!
|
19
14
|
///////////////////////////////////////////
|
@@ -538,9 +533,4 @@ Supported values: `us` `usec` `usecs`, e.g. "600 us", "800 usec", "900 usecs"
|
|
538
533
|
[NOTE]
|
539
534
|
`micro` `micros` and `microseconds` are not supported
|
540
535
|
|
541
|
-
ifeval::["{versioned_docs}"=="true"]
|
542
|
-
:branch: current
|
543
|
-
:ecs_version: current
|
544
|
-
endif::[]
|
545
|
-
|
546
536
|
:default_codec!:
|
@@ -29,7 +29,7 @@ module FileWatch module ReadMode module Handlers
|
|
29
29
|
gzip_stream = GZIPInputStream.new(file_stream)
|
30
30
|
decoder = InputStreamReader.new(gzip_stream, "UTF-8")
|
31
31
|
buffered = BufferedReader.new(decoder)
|
32
|
-
while (line = buffered.readLine(
|
32
|
+
while (line = buffered.readLine())
|
33
33
|
watched_file.listener.accept(line)
|
34
34
|
# can't quit, if we did then we would incorrectly write a 'completed' sincedb entry
|
35
35
|
# what do we do about quit when we have just begun reading the zipped file (e.g. pipeline reloading)
|
@@ -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
|