logstash-codec-multiline 3.1.0 → 3.1.1

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: a4ecbf8730e688adbacb1af57c98f7c5105b5677337b140a22b6ccb41e1468ea
4
- data.tar.gz: 299167720ec0457af53b7f118b6e55bd6c078f6ac1b8e4978ca68872a04cbc7c
3
+ metadata.gz: 2579876a333e816be9826e4d9f0f02f67634a4e4370f90cbcde04465f9d18b2a
4
+ data.tar.gz: 4c915fe445fe7b98e3ce584432a196951317d5b8fe2be41897e0234fd25868a1
5
5
  SHA512:
6
- metadata.gz: 798b7fe3f963ade7578c655a00ba2ba7ea602dced4e463b170d8d7bf8b9e0585bedda761f9ee5bbbcb8026d99e0cbc3dc22bdfc19abe063c5d3716c2b8e0fd03
7
- data.tar.gz: b4758f3f75e0ad1e470800aff9ccf353f8f4493cbcd6b30f687ef3fa74973e5baf0aba65a25450b83b3269879065ab5878141914dd3c35998e0bad4ca631b8bd
6
+ metadata.gz: 44f1bba5815ee431f52265a630628b41e5b0460a23d54fb1eccd3d21004f1fd441129434baf75616995d27ff28c2925d04510f83e36fd02d5af9e5a23dad3250
7
+ data.tar.gz: 3770b8ed35551d6c21a88f037b0ed94417b7fad630f5e680afa1bb93ca481d985d593c29af77e8537b40eb85adec5e7e2743dcf293c64aa4056a510056b573df
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.1.1
2
+ - Fix: avoid reusing per-identity codec instances for differing identities. Removes a very minor optimization so that stateful codecs like CSV can work reliably [#70](https://github.com/logstash-plugins/logstash-codec-multiline/pull/70)
3
+
1
4
  ## 3.1.0
2
5
  - Feat: ECS compatibility [#69](https://github.com/logstash-plugins/logstash-codec-multiline/pull/69)
3
6
 
@@ -290,6 +290,7 @@ module LogStash module Codecs class IdentityMapCodec
290
290
  end
291
291
 
292
292
  def codec_without_usage_update(identity)
293
+ return base_codec if identity.nil? # mirror optimization in `stream_codec`
293
294
  find_codec_value(identity).codec
294
295
  end
295
296
 
@@ -336,7 +337,7 @@ module LogStash module Codecs class IdentityMapCodec
336
337
  end
337
338
 
338
339
  def codec_builder(hash, k)
339
- codec = hash.empty? ? @base_codec : @base_codec.clone
340
+ codec = @base_codec.clone
340
341
  codec.use_mapper_auto_flush if using_mapped_auto_flush?
341
342
  compo = CodecValue.new(codec).tap do |o|
342
343
  now = Time.now
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-codec-multiline'
4
- s.version = '3.1.0'
4
+ s.version = '3.1.1'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Merges multiline messages into a single event"
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"
@@ -29,7 +29,8 @@ describe LogStash::Codecs::IdentityMapCodec do
29
29
  let(:stream1) { nil }
30
30
 
31
31
  it "transparently refers to the original codec" do
32
- expect(codec).to eql(codec1)
32
+ resolved_codec = demuxer.codec_without_usage_update(stream1)
33
+ expect(resolved_codec).to eq(codec)
33
34
  end
34
35
  end
35
36
 
@@ -37,8 +38,8 @@ describe LogStash::Codecs::IdentityMapCodec do
37
38
 
38
39
  before { demuxer.decode(arg1, stream1) }
39
40
 
40
- it "the first identity refers to the original codec" do
41
- expect(codec).to eql(codec1)
41
+ it "the first identity refers to a copy of original codec" do
42
+ expect(codec1).to_not eql(codec)
42
43
  end
43
44
  end
44
45
 
@@ -212,8 +213,11 @@ describe LogStash::Codecs::IdentityMapCodec do
212
213
  let(:demuxer) { described_class.new(codec).evict_timeout(1).cleaner_interval(1) }
213
214
  it "the cleaner evicts the codec and flushes it first" do
214
215
  demuxer.decode(Object.new, "stream1"){|*| 42}
216
+ mapped_codec = demuxer.codec_without_usage_update("stream1") # get before eviction
217
+
215
218
  sleep(2.1)
216
- expect(codec.trace_for(:flush)).to eq(42)
219
+
220
+ expect(mapped_codec.trace_for(:flush)).to eq(42)
217
221
  expect(demuxer.identity_map.keys).not_to include("stream1")
218
222
  end
219
223
  end
@@ -227,9 +231,12 @@ describe LogStash::Codecs::IdentityMapCodec do
227
231
  end
228
232
  it "the cleaner evicts the codec and flushes it first using the eviction_block" do
229
233
  demuxer.decode(Object.new, "stream1"){|*| 42}
234
+ mapped_codec = demuxer.codec_without_usage_update("stream1") # get before eviction
235
+
230
236
  sleep(2.1)
231
- expect(codec.trace_for(:flush)).to eq(24)
232
- expect(demuxer.identity_map.keys).not_to include("stream1")
237
+
238
+ expect(mapped_codec.trace_for(:flush)).to eq(24)
239
+ expect(demuxer.identity_map.keys).to_not include("stream1")
233
240
  end
234
241
  end
235
242
  end
@@ -251,7 +258,9 @@ describe LogStash::Codecs::IdentityMapCodec do
251
258
  it "no events are generated (the line is buffered)" do
252
259
  expect(imc.identity_count).to eq(1)
253
260
  expect(queue.size).to eq(0)
254
- expect(mlc.internal_buffer[0]).to eq("foo")
261
+
262
+ mapped_codec = imc.codec_without_usage_update(identity)
263
+ expect(mapped_codec.internal_buffer[0]).to eq("foo")
255
264
  end
256
265
  end
257
266
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-codec-multiline
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-27 00:00:00.000000000 Z
11
+ date: 2021-09-28 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.3'
39
39
  name: logstash-mixin-ecs_compatibility_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-event_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: '0'
67
67
  name: logstash-patterns-core
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: 0.11.1
81
81
  name: jls-grok
82
- type: :runtime
83
82
  prerelease: false
83
+ type: :runtime
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
@@ -93,8 +93,8 @@ dependencies:
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  name: concurrent-ruby
96
- type: :runtime
97
96
  prerelease: false
97
+ type: :runtime
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - ">="
@@ -107,8 +107,8 @@ dependencies:
107
107
  - !ruby/object:Gem::Version
108
108
  version: '0'
109
109
  name: logstash-devutils
110
- type: :development
111
110
  prerelease: false
111
+ type: :development
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - ">="
@@ -121,8 +121,8 @@ dependencies:
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  name: insist
124
- type: :development
125
124
  prerelease: false
125
+ type: :development
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - ">="
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  - !ruby/object:Gem::Version
174
174
  version: '0'
175
175
  requirements: []
176
- rubygems_version: 3.0.6
176
+ rubygems_version: 3.1.6
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: Merges multiline messages into a single event