logstash-input-dead_letter_queue 1.1.10 → 1.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f72ab4a3d095208dd728b509cf547ef47c8951d5093027a72254674c52a79baa
4
- data.tar.gz: 3c584acddee29a2f11327087a145b12cbee811ba844abc886df1c797cbf1cc21
3
+ metadata.gz: 9a9f7c1ca29e4d2e0b409b3a7f56d69b800ca1321386e9402530605224fbc64e
4
+ data.tar.gz: efc30664c8fc92365eda9e20cadffdd67123c9a80d79a04a3160dae5fcf6b33e
5
5
  SHA512:
6
- metadata.gz: d66fc9550df26ec02d4f8872007131825e243c2429410698d4e94844ae71760831803b3beb7db8810de6698fb5e5b495d67763f96d79dfd076131a7d9aea92fd
7
- data.tar.gz: 8a42ff2bc10cd95892a48bb6c38a6f95940cd0b3098bcc1b8084b2da4d12b6650dfa02d645e50d5c68a695f3b8fd2a590ee80f2d5f880bcad247a5815ed2d1e0
6
+ metadata.gz: 9da83407c607cd6977d988f3da9972ec6aba3e9383aabfef709f79f777b67a81c3d9f15f4a3fb7e7ab6e10e725bb7482b7689671851ba08e96e85b8a0337e8c9
7
+ data.tar.gz: 9bb864de1fe4c5d9d5c8a137e9977454dfcbf0d862454847ebd18cedc98451d4b3e3989a6e3bf68de65816600b424eb148e600beaea516aaea86d17a7c052f11
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
+ ## 1.1.11
2
+ - Fix: pre-flight checks before creating DLQ reader [#35](https://github.com/logstash-plugins/logstash-input-dead_letter_queue/pull/35)
3
+
1
4
  ## 1.1.10
2
5
  - Fix, avoid Logstash crash on shutdown if DLQ files weren't created [#33](https://github.com/logstash-plugins/logstash-input-dead_letter_queue/pull/33)
6
+
3
7
  ## 1.1.9
4
8
  - Fix `@metadata` get overwritten by reestablishing metadata that stored in DLQ [#34](https://github.com/logstash-plugins/logstash-input-dead_letter_queue/pull/34)
5
9
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.10
1
+ 1.1.11
@@ -2,6 +2,8 @@ require 'logstash/namespace'
2
2
  require 'logstash/inputs/base'
3
3
  require 'logstash-input-dead_letter_queue_jars'
4
4
 
5
+ require 'fileutils'
6
+
5
7
  # Logstash input to read events from Logstash's dead letter queue
6
8
  #
7
9
  # [source, sh]
@@ -45,7 +47,7 @@ class LogStash::Inputs::DeadLetterQueue < LogStash::Inputs::Base
45
47
  FileUtils::mkdir_p datapath
46
48
  @sincedb_path = File.join(datapath, ".sincedb_" + Digest::MD5.hexdigest(@path))
47
49
  elsif File.directory?(@sincedb_path)
48
- raise ArgumentError.new("The \"sincedb_path\" argument must point to a file, received a directory: \"#{@sincedb_path}\"")
50
+ raise ArgumentError.new("The \"sincedb_path\" argument must point to a file, received a directory: \"#{@sincedb_path}\"")
49
51
  end
50
52
 
51
53
  dlq_path = java.nio.file.Paths.get(File.join(@path, @pipeline_id))
@@ -53,20 +55,24 @@ class LogStash::Inputs::DeadLetterQueue < LogStash::Inputs::Base
53
55
  start_timestamp = @start_timestamp ? org.logstash.Timestamp.new(@start_timestamp) : nil
54
56
  @inner_plugin = org.logstash.input.DeadLetterQueueInputPlugin.new(dlq_path, @commit_offsets, sincedb_path, start_timestamp)
55
57
  @inner_plugin.register
58
+
59
+ if Gem::Requirement.new('< 7.0').satisfied_by?(Gem::Version.new(LOGSTASH_CORE_VERSION))
60
+ @event_creator = Proc.new do |entry|
61
+ clone = entry.event.clone
62
+ # LS 6 LogStash::Event.new accept Map not Event
63
+ event = LogStash::Event.new(clone.getData())
64
+ event.set("[@metadata]", clone.getMetadata())
65
+ event
66
+ end
67
+ else
68
+ @event_creator = -> (entry) { LogStash::Event.new(entry.event.clone) }
69
+ end
56
70
  end # def register
57
71
 
58
72
  public
59
73
  def run(logstash_queue)
60
74
  @inner_plugin.run do |entry|
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
75
+ event = @event_creator.(entry)
70
76
  event.set("[@metadata][dead_letter_queue][plugin_type]", entry.plugin_type)
71
77
  event.set("[@metadata][dead_letter_queue][plugin_id]", entry.plugin_id)
72
78
  event.set("[@metadata][dead_letter_queue][reason]", entry.reason)
@@ -1,4 +1,4 @@
1
1
  # AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT.
2
2
 
3
3
  require 'jar_dependencies'
4
- require_jar('co.elastic.logstash.input', 'logstash-input-dead_letter_queue', '1.1.10')
4
+ require_jar('co.elastic.logstash.input', 'logstash-input-dead_letter_queue', '1.1.11')
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.10
4
+ version: 1.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-07 00:00:00.000000000 Z
11
+ date: 2022-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -80,7 +80,7 @@ files:
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.10/logstash-input-dead_letter_queue-1.1.10.jar
83
+ - vendor/jar-dependencies/co/elastic/logstash/input/logstash-input-dead_letter_queue/1.1.11/logstash-input-dead_letter_queue-1.1.11.jar
84
84
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
85
85
  licenses:
86
86
  - Apache License (2.0)