logstash-codec-rfc6587 0.1.2 → 0.1.3

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: 15099317e64a62990e4c3f58872acd7c75e3efbc384343052a078003ce1260f3
4
- data.tar.gz: 25eeec0596b026729fd2d0982609de06c77171c33cb7647a4a7377024663747e
3
+ metadata.gz: e5adb89a59064d2b4fa6c6456fc6316773c7dda6f212c1b5d7da598e861ead16
4
+ data.tar.gz: d4465dde3f19103840dc48a65ed6872c0f3ab222bb94c2e98af1daefc77683a7
5
5
  SHA512:
6
- metadata.gz: 8da66783b0b0326f11d507ba5cbc024ef871a62bda77bcbc6bdc7cfcdf210a77bdaae1d33d128ca7998261d5904854d83a2707ebea7aae822379c911ebaed1d0
7
- data.tar.gz: 9667b5c7002f3739b9d4175931375c165ba17119e8b4884296336af5d495b86fbd69f85af1d8ae38bbf76a5096b639030cb9766cf46acad8d4d7ff01d8443978
6
+ metadata.gz: 83f832296b5189bf89f6c1a1c9006be09d90d7e03572df7e4f2bfcddbb149abc0fa38a6ac04ce1245f09e997985cfe059cc400621f865c4a9fce014127fa2c93
7
+ data.tar.gz: 4cd529e5d4b922fd053fc80a8fe7538fbb3a95f0be1d3a41a446a4dddf0eccd1778e03147d45b78c63326381eda2c9238edc6c5a5eb2d7e28c44fd24c13e6323
@@ -61,7 +61,8 @@ class LogStash::Codecs::Rfc6587 < LogStash::Codecs::Base
61
61
  end
62
62
 
63
63
  to_read = header.to_i
64
- line = data.gets(to_read)
64
+ line = ""
65
+ to_read.times { line += data.getc }
65
66
 
66
67
  if not line
67
68
  @leftover = header
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-codec-rfc6587'
4
- s.version = '0.1.2'
4
+ s.version = '0.1.3'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Reads lines as described in rfc6587"
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"
@@ -86,6 +86,15 @@ describe LogStash::Codecs::Rfc6587, :ecs_compatibility_support do
86
86
  insist { decoded } == true
87
87
  end
88
88
 
89
+ it "should contain correct results when input contains newline" do
90
+ result = []
91
+ subject.decode("5 line17 line2\n!5 line3") { |e| result << e }
92
+ subject.flush { |e| result << e }
93
+ expect(result.size).to eq(3)
94
+ expect(result[0].get("message")).to eq("line1")
95
+ expect(result[1].get("message")).to eq("line2\n!")
96
+ expect(result[2].get("message")).to eq("line3")
97
+ end
89
98
 
90
99
  ecs_compatibility_matrix(:disabled, :v1, :v8 => :v1) do |ecs_select|
91
100
 
@@ -137,6 +146,7 @@ describe LogStash::Codecs::Rfc6587, :ecs_compatibility_support do
137
146
  expect(result[1].get("message")).to eq("line2")
138
147
  expect(result[2].get("message")).to eq("line3")
139
148
  end
149
+
140
150
  end
141
151
  end
142
152
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-codec-rfc6587
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-03-01 00:00:00.000000000 Z
12
+ date: 2024-10-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement
@@ -21,8 +21,8 @@ dependencies:
21
21
  - !ruby/object:Gem::Version
22
22
  version: '2.99'
23
23
  name: logstash-core-plugin-api
24
- type: :runtime
25
24
  prerelease: false
25
+ type: :runtime
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
28
  - - ">="
@@ -38,8 +38,8 @@ dependencies:
38
38
  - !ruby/object:Gem::Version
39
39
  version: '1.0'
40
40
  name: logstash-mixin-event_support
41
- type: :runtime
42
41
  prerelease: false
42
+ type: :runtime
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
@@ -52,8 +52,8 @@ dependencies:
52
52
  - !ruby/object:Gem::Version
53
53
  version: '1.3'
54
54
  name: logstash-mixin-ecs_compatibility_support
55
- type: :runtime
56
55
  prerelease: false
56
+ type: :runtime
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
@@ -66,8 +66,8 @@ dependencies:
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  name: logstash-devutils
69
- type: :development
70
69
  prerelease: false
70
+ type: :development
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -80,8 +80,8 @@ dependencies:
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  name: insist
83
- type: :development
84
83
  prerelease: false
84
+ type: :development
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="