logstash-codec-json_lines 3.0.5 → 3.0.6
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/LICENSE +1 -1
- data/lib/logstash/codecs/json_lines.rb +7 -0
- data/logstash-codec-json_lines.gemspec +2 -2
- data/spec/codecs/json_lines_spec.rb +19 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edbff14bdc579c0b6c6f7f607ef8e81873e2ea8c9404a15310cf8c8129b3c22d
|
4
|
+
data.tar.gz: cf3e588e9db2101e137787f18e6254450cf20bdb60e9af852241c2893f290c33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d70360d5ab80210d388c3ae0b7c55fb869565b565e4fc32859624f4325dfaaf03d589ed1e5201d2a7e712df56e2a86b8e20f19bb324f7974872e75848b606dbc
|
7
|
+
data.tar.gz: 321f6af47b9ccadaa216dc1d1473f286266758434b9b3368f914688231995de27961366590aa0bf335c2d830aa51f0b43c71c81b85caf8a0cb6123e34fbcac45
|
data/CHANGELOG.md
CHANGED
data/LICENSE
CHANGED
@@ -48,6 +48,13 @@ class LogStash::Codecs::JSONLines < LogStash::Codecs::Base
|
|
48
48
|
@on_event.call(event, "#{event.to_json}#{@delimiter}")
|
49
49
|
end
|
50
50
|
|
51
|
+
def flush(&block)
|
52
|
+
remainder = @buffer.flush
|
53
|
+
if !remainder.empty?
|
54
|
+
parse(@converter.convert(remainder), &block)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
51
58
|
private
|
52
59
|
|
53
60
|
# from_json_parse uses the Event#from_json method to deserialize and directly produce events
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-codec-json_lines'
|
4
|
-
s.version = '3.0.
|
4
|
+
s.version = '3.0.6'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
|
-
s.summary = "Reads newline-delimited JSON"
|
6
|
+
s.summary = "Reads and writes newline-delimited JSON"
|
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"
|
8
8
|
s.authors = ["Elastic"]
|
9
9
|
s.email = 'info@elastic.co'
|
@@ -214,5 +214,24 @@ describe LogStash::Codecs::JSONLines do
|
|
214
214
|
LogStash::Codecs::JSONLines.new(codec_options)
|
215
215
|
end
|
216
216
|
end
|
217
|
+
|
218
|
+
context "flush" do
|
219
|
+
subject do
|
220
|
+
LogStash::Codecs::JSONLines.new(codec_options)
|
221
|
+
end
|
222
|
+
|
223
|
+
let(:input) { "{\"foo\":\"bar\"}" }
|
224
|
+
|
225
|
+
it "should flush buffered data'" do
|
226
|
+
result = []
|
227
|
+
subject.decode(input) { |e| result << e }
|
228
|
+
expect(result.size).to eq(0)
|
229
|
+
|
230
|
+
subject.flush { |e| result << e }
|
231
|
+
expect(result.size).to eq(1)
|
232
|
+
|
233
|
+
expect(result[0].get("foo")).to eq("bar")
|
234
|
+
end
|
235
|
+
end
|
217
236
|
end
|
218
237
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-codec-json_lines
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,9 +98,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
100
|
rubyforge_project:
|
101
|
-
rubygems_version: 2.6.
|
101
|
+
rubygems_version: 2.6.13
|
102
102
|
signing_key:
|
103
103
|
specification_version: 4
|
104
|
-
summary: Reads newline-delimited JSON
|
104
|
+
summary: Reads and writes newline-delimited JSON
|
105
105
|
test_files:
|
106
106
|
- spec/codecs/json_lines_spec.rb
|