logstash-codec-fluent 3.4.0-java → 3.4.1-java
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/lib/logstash/codecs/fluent.rb +1 -1
- data/logstash-codec-fluent.gemspec +1 -1
- data/spec/codecs/fluent_spec.rb +41 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa2fd8d949aa00ed210e7715803b3bf20c3574a63dd6d7c4c962bb566652d756
|
4
|
+
data.tar.gz: b14c9124fab77dc4c808f5af0ff291e79a5fd362cefccdcae19c7e1ad488e24e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6314b384f04df293ba102eeabe9a0c500b1f0258e680a6157c09d907b5d98ac6006ce808f73d8044045d5a1553309600ca4cb973dee188a766e85075be84b6c
|
7
|
+
data.tar.gz: b015062ffe93575ab9b176f2d06ea6cdf9bdb6cdb7408aaa79a4be5cec2ae08e57065e99f809c2ac3e8ef80cc0ac557172561a197fd9f59f001296663d1ff852
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 3.4.1
|
2
|
+
- Fix: handle multiple PackForward-encoded messages in a single payload [#28](https://github.com/logstash-plugins/logstash-codec-fluent/pull/28)
|
3
|
+
|
1
4
|
## 3.4.0
|
2
5
|
- Feat: added target configuration + event-factory support [#27](https://github.com/logstash-plugins/logstash-codec-fluent/pull/27)
|
3
6
|
- Fix: decoding of time's nano-second precision
|
@@ -117,7 +117,7 @@ class LogStash::Codecs::Fluent < LogStash::Codecs::Base
|
|
117
117
|
raise(LogStash::Error, "PackedForward with compression is not supported")
|
118
118
|
end
|
119
119
|
|
120
|
-
entries_decoder = @
|
120
|
+
entries_decoder = @factory.unpacker
|
121
121
|
entries_decoder.feed_each(entries) do |entry|
|
122
122
|
yield generate_event(entry[1], entry[0], tag)
|
123
123
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-codec-fluent'
|
4
|
-
s.version = '3.4.
|
4
|
+
s.version = '3.4.1'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Reads the `fluentd` `msgpack` schema"
|
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/codecs/fluent_spec.rb
CHANGED
@@ -13,7 +13,7 @@ describe LogStash::Codecs::Fluent do
|
|
13
13
|
@unpacker = @factory.unpacker
|
14
14
|
end
|
15
15
|
|
16
|
-
subject { LogStash::Codecs::Fluent.new(config) }
|
16
|
+
subject(:fluent_codec) { LogStash::Codecs::Fluent.new(config) }
|
17
17
|
|
18
18
|
let(:config) { Hash.new }
|
19
19
|
|
@@ -202,6 +202,46 @@ describe LogStash::Codecs::Fluent do
|
|
202
202
|
|
203
203
|
end
|
204
204
|
|
205
|
+
describe "event decoding (multiple PackForward messages)" do
|
206
|
+
def pack_events(logstash_events)
|
207
|
+
packer = @factory.packer
|
208
|
+
logstash_events.map {|logstash_event| [logstash_event.timestamp.to_i, logstash_event.to_hash.merge(LogStash::Event::TIMESTAMP => logstash_event.timestamp.to_iso8601)] }
|
209
|
+
.each {|fluentd_event_tuple| packer.pack(fluentd_event_tuple) }
|
210
|
+
packer.to_s
|
211
|
+
end
|
212
|
+
|
213
|
+
def generate_event(idx)
|
214
|
+
LogStash::Event.new("idx" => idx)
|
215
|
+
end
|
216
|
+
|
217
|
+
def generate_events(idx_range)
|
218
|
+
idx_range.map {|idx| generate_event(idx) }
|
219
|
+
end
|
220
|
+
|
221
|
+
# our message needs to contain _multiple_ PackForward events, at least
|
222
|
+
# one of which contains multiple Events in its pack. This ensures we don't
|
223
|
+
# cross wires with our pack buffers.
|
224
|
+
let(:message) do
|
225
|
+
@factory.packer.pack([tag, pack_events(generate_events(000...100))])
|
226
|
+
.pack([tag, pack_events(generate_events(100...117))])
|
227
|
+
.pack([tag, pack_events([generate_event(117)])])
|
228
|
+
.pack([tag, pack_events([generate_event(118)])])
|
229
|
+
.pack([tag, pack_events(generate_events(119...199))])
|
230
|
+
.to_s
|
231
|
+
end
|
232
|
+
|
233
|
+
it 'decodes packed events without errors' do
|
234
|
+
seen = []
|
235
|
+
|
236
|
+
fluent_codec.decode(message) do |event|
|
237
|
+
seen << event.get("idx")
|
238
|
+
expect(event.get("tags")).to be_a_kind_of(Array).and(include(tag))
|
239
|
+
end
|
240
|
+
|
241
|
+
expect(seen).to match_array((000...199).to_a) # unordered
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
205
245
|
describe "event decoding (broken package)" do
|
206
246
|
|
207
247
|
let(:epochtime) { timestamp.to_s }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-codec-fluent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.1
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -20,8 +20,8 @@ dependencies:
|
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '2.99'
|
22
22
|
name: logstash-core-plugin-api
|
23
|
-
type: :runtime
|
24
23
|
prerelease: false
|
24
|
+
type: :runtime
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
@@ -37,8 +37,8 @@ dependencies:
|
|
37
37
|
- !ruby/object:Gem::Version
|
38
38
|
version: '1.0'
|
39
39
|
name: logstash-mixin-event_support
|
40
|
-
type: :runtime
|
41
40
|
prerelease: false
|
41
|
+
type: :runtime
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
@@ -51,8 +51,8 @@ dependencies:
|
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: '1.0'
|
53
53
|
name: logstash-mixin-validator_support
|
54
|
-
type: :runtime
|
55
54
|
prerelease: false
|
55
|
+
type: :runtime
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
@@ -65,8 +65,8 @@ dependencies:
|
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '1.1'
|
67
67
|
name: msgpack
|
68
|
-
type: :runtime
|
69
68
|
prerelease: false
|
69
|
+
type: :runtime
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
@@ -79,8 +79,8 @@ dependencies:
|
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: 1.0.0
|
81
81
|
name: logstash-devutils
|
82
|
-
type: :development
|
83
82
|
prerelease: false
|
83
|
+
type: :development
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - ">="
|
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
- !ruby/object:Gem::Version
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
|
-
rubygems_version: 3.
|
130
|
+
rubygems_version: 3.1.6
|
131
131
|
signing_key:
|
132
132
|
specification_version: 4
|
133
133
|
summary: Reads the `fluentd` `msgpack` schema
|