logstash-input-dead_letter_queue 1.1.8 → 1.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/lib/logstash/inputs/dead_letter_queue.rb +9 -1
- data/lib/logstash-input-dead_letter_queue_jars.rb +1 -1
- data/spec/unit/inputs/dead_letter_queue_spec.rb +28 -1
- data/spec/unit/inputs/fixtures/main/1.log +0 -0
- data/vendor/jar-dependencies/co/elastic/logstash/input/logstash-input-dead_letter_queue/{1.1.8/logstash-input-dead_letter_queue-1.1.8.jar → 1.1.9/logstash-input-dead_letter_queue-1.1.9.jar} +0 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8c3914781267098a3ca870e2497905c0ce1c7fb8d8faf641744391f5e488066
|
4
|
+
data.tar.gz: 2ccac6b74e55459931228ae0cb1a1766b5e79b03a2333c7e6bec325156a0c9fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 285bd36daf838edda23f623868f6efeb63af4a8243cc7c9328a574981c2d7819425156a79a8e99f50fb2fd8d09924f639d0dd115ead5f12554b6888bce59a5eb
|
7
|
+
data.tar.gz: 6fea6fdd41eb183894e6c7970686c7b86b2577f77081a6cf7015dd49a4ce9f1b1b1f878d215912c3b047d8c1dfa1830a4b22aaf2fa4024b2e83ea755fa32b52c
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.9
|
@@ -58,7 +58,15 @@ class LogStash::Inputs::DeadLetterQueue < LogStash::Inputs::Base
|
|
58
58
|
public
|
59
59
|
def run(logstash_queue)
|
60
60
|
@inner_plugin.run do |entry|
|
61
|
-
|
61
|
+
clone = entry.event.clone()
|
62
|
+
event = if Gem::Requirement.new('< 7.0').satisfied_by?(Gem::Version.new(LOGSTASH_CORE_VERSION))
|
63
|
+
# LS 6 LogStash::Event.new accept Map not Event
|
64
|
+
event = LogStash::Event.new(clone.getData())
|
65
|
+
event.set("[@metadata]", clone.getMetadata())
|
66
|
+
event
|
67
|
+
else
|
68
|
+
LogStash::Event.new(clone)
|
69
|
+
end
|
62
70
|
event.set("[@metadata][dead_letter_queue][plugin_type]", entry.plugin_type)
|
63
71
|
event.set("[@metadata][dead_letter_queue][plugin_id]", entry.plugin_id)
|
64
72
|
event.set("[@metadata][dead_letter_queue][reason]", entry.reason)
|
@@ -19,8 +19,35 @@ describe LogStash::Inputs::DeadLetterQueue do
|
|
19
19
|
expect {subject.register}.to_not raise_error
|
20
20
|
end
|
21
21
|
|
22
|
-
|
23
22
|
after(:each) do
|
24
23
|
FileUtils.remove_entry_secure directory
|
25
24
|
end
|
25
|
+
|
26
|
+
context 'test with real DLQ file' do
|
27
|
+
let(:dlq_dir) { Stud::Temporary.directory }
|
28
|
+
let(:fixture_dir) { File.expand_path(File.join(File.dirname(__FILE__),"fixtures", "main")) }
|
29
|
+
let(:plugin) { LogStash::Inputs::DeadLetterQueue.new({ "path" => dlq_dir, "commit_offsets" => true }) }
|
30
|
+
let(:queue) { Queue.new }
|
31
|
+
|
32
|
+
before do
|
33
|
+
FileUtils.cp_r fixture_dir, dlq_dir
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'reserve original metadata' do
|
37
|
+
plugin.register
|
38
|
+
t = Thread.new {
|
39
|
+
begin
|
40
|
+
plugin.run(queue)
|
41
|
+
rescue java.nio.file.ClosedWatchServiceException => e
|
42
|
+
end
|
43
|
+
}
|
44
|
+
|
45
|
+
event = queue.pop
|
46
|
+
expect(event.get("[@metadata][some_key]")).to eq("some_value")
|
47
|
+
expect(event.get("[@metadata][dead_letter_queue][reason]")).to match(/Could not index event to Elasticsearch. status: 400/)
|
48
|
+
|
49
|
+
plugin.stop
|
50
|
+
t.join(1000)
|
51
|
+
end
|
52
|
+
end
|
26
53
|
end
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-dead_letter_queue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,7 +79,8 @@ files:
|
|
79
79
|
- lib/logstash/inputs/dead_letter_queue.rb
|
80
80
|
- logstash-input-dead_letter_queue.gemspec
|
81
81
|
- spec/unit/inputs/dead_letter_queue_spec.rb
|
82
|
-
-
|
82
|
+
- spec/unit/inputs/fixtures/main/1.log
|
83
|
+
- vendor/jar-dependencies/co/elastic/logstash/input/logstash-input-dead_letter_queue/1.1.9/logstash-input-dead_letter_queue-1.1.9.jar
|
83
84
|
homepage: http://www.elastic.co/guide/en/logstash/current/index.html
|
84
85
|
licenses:
|
85
86
|
- Apache License (2.0)
|
@@ -108,3 +109,4 @@ specification_version: 4
|
|
108
109
|
summary: read events from Logstash's dead letter queue
|
109
110
|
test_files:
|
110
111
|
- spec/unit/inputs/dead_letter_queue_spec.rb
|
112
|
+
- spec/unit/inputs/fixtures/main/1.log
|