logstash-input-beats 6.8.3-java → 6.9.0-java
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 +8 -0
- data/VERSION +1 -1
- data/lib/logstash/inputs/beats/codec_callback_listener.rb +2 -2
- data/lib/logstash/inputs/beats/message_listener.rb +14 -7
- data/lib/logstash-input-beats_jars.rb +1 -1
- data/spec/inputs/beats/message_listener_spec.rb +27 -0
- data/vendor/jar-dependencies/org/logstash/beats/logstash-input-beats/{6.8.3/logstash-input-beats-6.8.3.jar → 6.9.0/logstash-input-beats-6.9.0.jar} +0 -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: 01fefa4a08a49d5b8327676fb8e9699f4dac1a656c4af806bfd52ab8b4765525
|
|
4
|
+
data.tar.gz: 5088c69b9ee6e5af1fd1eca90bafc1666834a6fa33759d7f5ec11e55d118b095
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 397e56a448f16eb3b0c149924b84474c494d680ebf9f5b51fbda46fc11d2cd3ab94896be435dde4e094b7b737fde9623d44feb2e922f74f50456420137d63948
|
|
7
|
+
data.tar.gz: c68a662dbb9494535b3200c2a0866da4fb2703667be266868b4214755b32e169ec1fee640a2c54b12c4b2a999f8d3b58e7126726eadbfbf66888d1d1664bec24
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 6.9.0
|
|
2
|
+
- Improvements on plugin's shutdown [#500](https://github.com/logstash-plugins/logstash-input-beats/pull/500)
|
|
3
|
+
- Fix: avoid plugin crash when connection terminated but processing the message
|
|
4
|
+
- Graceful shutdown: close acceptor group (incoming socket handler) first, ask and wait for the executors which have pending tasks, better message handling when executors terminated
|
|
5
|
+
|
|
6
|
+
## 6.8.4
|
|
7
|
+
- Fixed to populate the `@metadata` fields even if the source's metadata value is `nil` [#502](https://github.com/logstash-plugins/logstash-input-beats/pull/502)
|
|
8
|
+
|
|
1
9
|
## 6.8.3
|
|
2
10
|
- bump netty to 4.1.109 [#495](https://github.com/logstash-plugins/logstash-input-beats/pull/495)
|
|
3
11
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.
|
|
1
|
+
6.9.0
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
require "logstash/inputs/beats"
|
|
3
3
|
|
|
4
4
|
module LogStash module Inputs class Beats
|
|
5
|
-
# Use the new callback based
|
|
5
|
+
# Use the new callback based approach instead of using blocks
|
|
6
6
|
# so we can retain some context of the execution, and make it easier to test
|
|
7
7
|
class CodecCallbackListener
|
|
8
8
|
attr_accessor :data
|
|
9
9
|
# The path acts as the `stream_identity`,
|
|
10
|
-
#
|
|
10
|
+
# useful when the clients is reading multiples files
|
|
11
11
|
attr_accessor :path
|
|
12
12
|
|
|
13
13
|
def initialize(data, hash, path, transformer, queue)
|
|
@@ -35,7 +35,7 @@ module LogStash module Inputs class Beats
|
|
|
35
35
|
|
|
36
36
|
if @input.include_source_metadata?
|
|
37
37
|
ip_address = ip_address(ctx)
|
|
38
|
-
unless ip_address.nil?
|
|
38
|
+
unless ip_address.nil?
|
|
39
39
|
set_nested(hash, @input.field_hostip, ip_address)
|
|
40
40
|
end
|
|
41
41
|
end
|
|
@@ -49,11 +49,18 @@ module LogStash module Inputs class Beats
|
|
|
49
49
|
@nocodec_transformer.transform(event)
|
|
50
50
|
@queue << event
|
|
51
51
|
else
|
|
52
|
-
codec(ctx)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
current_codec = codec(ctx)
|
|
53
|
+
if current_codec
|
|
54
|
+
current_codec.accept(CodecCallbackListener.new(target_field,
|
|
55
|
+
hash,
|
|
56
|
+
message.getIdentityStream(),
|
|
57
|
+
@codec_transformer,
|
|
58
|
+
@queue))
|
|
59
|
+
else
|
|
60
|
+
# the possible cases: connection closed or exception with a connection
|
|
61
|
+
# let client retry
|
|
62
|
+
input.logger.warn("No codec available to process the message. This may due to connection termination and message was being processed.")
|
|
63
|
+
end
|
|
57
64
|
end
|
|
58
65
|
end
|
|
59
66
|
|
|
@@ -167,7 +174,7 @@ module LogStash module Inputs class Beats
|
|
|
167
174
|
field_ref = Java::OrgLogstash::FieldReference.from(field_name)
|
|
168
175
|
# create @metadata sub-hash if needed
|
|
169
176
|
if field_ref.type == Java::OrgLogstash::FieldReference::META_CHILD
|
|
170
|
-
nesting_hash = hash[
|
|
177
|
+
nesting_hash = hash['@metadata'] ||= {}
|
|
171
178
|
else
|
|
172
179
|
nesting_hash = hash
|
|
173
180
|
end
|
|
@@ -8,4 +8,4 @@ require_jar('io.netty', 'netty-transport', '4.1.109.Final')
|
|
|
8
8
|
require_jar('io.netty', 'netty-handler', '4.1.109.Final')
|
|
9
9
|
require_jar('io.netty', 'netty-transport-native-unix-common', '4.1.109.Final')
|
|
10
10
|
require_jar('org.javassist', 'javassist', '3.24.0-GA')
|
|
11
|
-
require_jar('org.logstash.beats', 'logstash-input-beats', '6.
|
|
11
|
+
require_jar('org.logstash.beats', 'logstash-input-beats', '6.9.0')
|
|
@@ -109,6 +109,15 @@ shared_examples "when the message is from any libbeat" do |ecs_compatibility, ho
|
|
|
109
109
|
expect(event.get(host_field_name)).to eq(nil)
|
|
110
110
|
end
|
|
111
111
|
end
|
|
112
|
+
|
|
113
|
+
context 'when @metadata is nil' do
|
|
114
|
+
let(:data) { super().reject { |k| '@metadata'.eql?(k) } }
|
|
115
|
+
|
|
116
|
+
it 'extracts event with the host field metadata set' do
|
|
117
|
+
subject.onNewMessage(ctx, message)
|
|
118
|
+
expect(queue.pop.get(host_field_name)).to eq(ip_address)
|
|
119
|
+
end
|
|
120
|
+
end
|
|
112
121
|
end
|
|
113
122
|
|
|
114
123
|
describe LogStash::Inputs::Beats::MessageListener do
|
|
@@ -209,6 +218,24 @@ describe LogStash::Inputs::Beats::MessageListener do
|
|
|
209
218
|
end
|
|
210
219
|
end
|
|
211
220
|
|
|
221
|
+
context "when connection is terminated" do
|
|
222
|
+
let(:message) { MockMessage.new("message from Mars", { "message" => "hello world", "@metadata" => {} } )}
|
|
223
|
+
|
|
224
|
+
it "handles without crashing" do
|
|
225
|
+
subject.onConnectionClose(ctx)
|
|
226
|
+
expect(subject.connections_list[ctx]).to be nil
|
|
227
|
+
|
|
228
|
+
expect( input.logger ).to receive(:warn) do |message |
|
|
229
|
+
expect( message ).to match /No codec available to process the message. This may due to connection termination and message was being processed./
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
subject.onNewMessage(ctx, message)
|
|
233
|
+
# doesn't push to queue, so should be nil
|
|
234
|
+
event = queue.pop
|
|
235
|
+
expect(event.get("message")).to be nil
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
212
239
|
it_behaves_like "when the message is from any libbeat", :disabled, "[@metadata][ip_address]"
|
|
213
240
|
it_behaves_like "when the message is from any libbeat", :v1, "[@metadata][input][beats][host][ip]"
|
|
214
241
|
it_behaves_like "when the message is from any libbeat", :v8, "[@metadata][input][beats][host][ip]"
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: logstash-input-beats
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.
|
|
4
|
+
version: 6.9.0
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- Elastic
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-08-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -326,7 +326,7 @@ files:
|
|
|
326
326
|
- vendor/jar-dependencies/io/netty/netty-transport-native-unix-common/4.1.109.Final/netty-transport-native-unix-common-4.1.109.Final.jar
|
|
327
327
|
- vendor/jar-dependencies/io/netty/netty-transport/4.1.109.Final/netty-transport-4.1.109.Final.jar
|
|
328
328
|
- vendor/jar-dependencies/org/javassist/javassist/3.24.0-GA/javassist-3.24.0-GA.jar
|
|
329
|
-
- vendor/jar-dependencies/org/logstash/beats/logstash-input-beats/6.
|
|
329
|
+
- vendor/jar-dependencies/org/logstash/beats/logstash-input-beats/6.9.0/logstash-input-beats-6.9.0.jar
|
|
330
330
|
homepage: http://www.elastic.co/guide/en/logstash/current/index.html
|
|
331
331
|
licenses:
|
|
332
332
|
- Apache License (2.0)
|