logstash-codec-json_lines 2.0.4 → 2.0.5
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/json_lines.rb +11 -11
- data/logstash-codec-json_lines.gemspec +2 -2
- data/spec/codecs/json_lines_spec.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 313c69ada5cae85d4921a4bb4d40966784a34eb4
|
4
|
+
data.tar.gz: f6e4543df04605d602fd8df5bb296877ca792e43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c6cfe1bbd4c7683077f2f8819211a0a9c78ae2a16e43d787c3155dd3ab8a9c6ca6f7b8c280d5f67159c73b3553590fbc47ca03b4c91d91c083370aab7021ce8
|
7
|
+
data.tar.gz: 3aaa57ac5fa0adff86f2c1eeaef369904f7932eb16704c66d3da4563c3d0bb532c00be38c9fe6374826038acba83c19e40d482d0b20270b687e2f8e359019d1c
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require "logstash/codecs/base"
|
3
|
-
require "logstash/
|
3
|
+
require "logstash/util/charset"
|
4
|
+
require "logstash/util/buftok"
|
4
5
|
require "logstash/json"
|
5
6
|
|
6
7
|
# This codec will decode streamed JSON that is newline delimited.
|
@@ -13,7 +14,6 @@ require "logstash/json"
|
|
13
14
|
class LogStash::Codecs::JSONLines < LogStash::Codecs::Base
|
14
15
|
config_name "json_lines"
|
15
16
|
|
16
|
-
|
17
17
|
# The character encoding used in this codec. Examples include `UTF-8` and
|
18
18
|
# `CP1252`
|
19
19
|
#
|
@@ -30,15 +30,15 @@ class LogStash::Codecs::JSONLines < LogStash::Codecs::Base
|
|
30
30
|
|
31
31
|
public
|
32
32
|
|
33
|
-
def
|
34
|
-
|
35
|
-
@
|
36
|
-
@
|
33
|
+
def register
|
34
|
+
@buffer = FileWatch::BufferedTokenizer.new(@delimiter)
|
35
|
+
@converter = LogStash::Util::Charset.new(@charset)
|
36
|
+
@converter.logger = @logger
|
37
37
|
end
|
38
38
|
|
39
39
|
def decode(data)
|
40
|
-
@
|
41
|
-
yield guard(
|
40
|
+
@buffer.extract(data).each do |line|
|
41
|
+
yield guard(@converter.convert(line))
|
42
42
|
end
|
43
43
|
end # def decode
|
44
44
|
|
@@ -50,11 +50,11 @@ class LogStash::Codecs::JSONLines < LogStash::Codecs::Base
|
|
50
50
|
|
51
51
|
private
|
52
52
|
|
53
|
-
def guard(
|
53
|
+
def guard(data)
|
54
54
|
begin
|
55
|
-
LogStash::Event.new(LogStash::Json.load(
|
55
|
+
LogStash::Event.new(LogStash::Json.load(data))
|
56
56
|
rescue LogStash::Json::ParserError => e
|
57
|
-
LogStash::Event.new("message" =>
|
57
|
+
LogStash::Event.new("message" => data, "tags" => ["_jsonparsefailure"])
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-codec-json_lines'
|
4
|
-
s.version = '2.0.
|
4
|
+
s.version = '2.0.5'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "This codec will decode streamed JSON that is newline delimited."
|
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/plugin install gemname. This gem is not a stand-alone program"
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.require_paths = ["lib"]
|
12
12
|
|
13
13
|
# Files
|
14
|
-
s.files = Dir['lib/**/*','spec/**/*','
|
14
|
+
s.files = Dir['lib/**/*','spec/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
|
15
15
|
|
16
16
|
# Tests
|
17
17
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
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: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-core
|