logstash-codec-rfc6587 0.1.3 → 0.1.4

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: e5adb89a59064d2b4fa6c6456fc6316773c7dda6f212c1b5d7da598e861ead16
4
- data.tar.gz: d4465dde3f19103840dc48a65ed6872c0f3ab222bb94c2e98af1daefc77683a7
3
+ metadata.gz: 35642c5e5db8b142c4afb325b96fb4cd24cf9b5f711c61476d601c382dcf4e57
4
+ data.tar.gz: 294de35a68a24b131e6fec7035d784161698c8ba82fee4fb676de7f763031aa7
5
5
  SHA512:
6
- metadata.gz: 83f832296b5189bf89f6c1a1c9006be09d90d7e03572df7e4f2bfcddbb149abc0fa38a6ac04ce1245f09e997985cfe059cc400621f865c4a9fce014127fa2c93
7
- data.tar.gz: 4cd529e5d4b922fd053fc80a8fe7538fbb3a95f0be1d3a41a446a4dddf0eccd1778e03147d45b78c63326381eda2c9238edc6c5a5eb2d7e28c44fd24c13e6323
6
+ metadata.gz: 48e8171e101c400fb9c42050a1b8303d0c920f567872e02bf76f003fdad211137fd42e8688b755148744dd2fef834a0e47b3169336a3e4273978c7509e168677
7
+ data.tar.gz: 51c30b54a8546cb2297c6d3ce8baccd297a16fa975c950ff6464cd801a8a6467485c5c6e6687410ccb3f9aa59c5c65c507bce8f55bedfb7bd73c2d1cf09868c6
@@ -62,7 +62,10 @@ class LogStash::Codecs::Rfc6587 < LogStash::Codecs::Base
62
62
 
63
63
  to_read = header.to_i
64
64
  line = ""
65
- to_read.times { line += data.getc }
65
+ to_read.times do
66
+ break if (c = data.getc) == nil
67
+ line += c
68
+ end
66
69
 
67
70
  if not line
68
71
  @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.3'
4
+ s.version = '0.1.4'
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"
@@ -96,6 +96,17 @@ describe LogStash::Codecs::Rfc6587, :ecs_compatibility_support do
96
96
  expect(result[2].get("message")).to eq("line3")
97
97
  end
98
98
 
99
+ it "should parse partial batches" do
100
+ result = []
101
+ subject.decode("5 line15 line") { |e| result << e }
102
+ subject.decode("25 line3") { |e| result << e }
103
+ subject.flush { |e| result << e }
104
+ expect(result.size).to eq(3)
105
+ expect(result[0].get("message")).to eq("line1")
106
+ expect(result[1].get("message")).to eq("line2")
107
+ expect(result[2].get("message")).to eq("line3")
108
+ end
109
+
99
110
  ecs_compatibility_matrix(:disabled, :v1, :v8 => :v1) do |ecs_select|
100
111
 
101
112
  before(:each) do
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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic