logstash-codec-json 2.1.4 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/Gemfile +3 -1
- data/LICENSE +1 -1
- data/README.md +11 -1
- data/logstash-codec-json.gemspec +3 -3
- data/spec/codecs/json_spec.rb +10 -10
- metadata +28 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5409411bfff11a5738c3d730d90c2c46d094bf7
|
4
|
+
data.tar.gz: 2a0eea25a7c0294240d6956257a3d3dab6d463ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1415abcd7fd069b7281d4e283ca128e6bf3a4ba84e4d620c05aaa00fdeba50c6dd54739a5f13942dd25cd19b05b58ff874f884a217f94b042705d6c3e227ddfc
|
7
|
+
data.tar.gz: e26e699b3a5843fe29cec501e83a41f2668bae76a74017f352d1f8d183016f9588ba39bbb9bc7b7406dd2c40b779aabb24ea435f4caac969243f34fd91fee532
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
## 3.0.0
|
2
|
+
- Update the plugin to the version 2.0 of the plugin api, this change is required for Logstash 5.0 compatibility. See https://github.com/elastic/logstash/issues/5141
|
1
3
|
# 2.1.4
|
2
4
|
- Made 'Falling back to plain-text' log message an 'info' level log. This was
|
3
5
|
'error' for versions v2.1.0 through v2.1.3 (and was 'info' before that).
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -55,7 +55,12 @@ gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
|
|
55
55
|
```
|
56
56
|
- Install plugin
|
57
57
|
```sh
|
58
|
+
# Logstash 2.3 and higher
|
59
|
+
bin/logstash-plugin install --no-verify
|
60
|
+
|
61
|
+
# Prior to Logstash 2.3
|
58
62
|
bin/plugin install --no-verify
|
63
|
+
|
59
64
|
```
|
60
65
|
- Run Logstash with your plugin
|
61
66
|
```sh
|
@@ -73,7 +78,12 @@ gem build logstash-filter-awesome.gemspec
|
|
73
78
|
```
|
74
79
|
- Install the plugin from the Logstash home
|
75
80
|
```sh
|
76
|
-
|
81
|
+
# Logstash 2.3 and higher
|
82
|
+
bin/logstash-plugin install --no-verify
|
83
|
+
|
84
|
+
# Prior to Logstash 2.3
|
85
|
+
bin/plugin install --no-verify
|
86
|
+
|
77
87
|
```
|
78
88
|
- Start Logstash and proceed to test the plugin
|
79
89
|
|
data/logstash-codec-json.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-codec-json'
|
4
|
-
s.version = '
|
4
|
+
s.version = '3.0.0'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "This codec may be used to decode (via inputs) and encode (via outputs) full JSON messages"
|
7
|
-
s.description = "This gem is a
|
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'
|
10
10
|
s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.metadata = { "logstash_plugin" => "true", "logstash_group" => "codec" }
|
21
21
|
|
22
22
|
# Gem dependencies
|
23
|
-
s.add_runtime_dependency "logstash-core-plugin-api", "~>
|
23
|
+
s.add_runtime_dependency "logstash-core-plugin-api", "~> 2.0"
|
24
24
|
|
25
25
|
s.add_development_dependency 'logstash-devutils'
|
26
26
|
end
|
data/spec/codecs/json_spec.rb
CHANGED
@@ -16,9 +16,9 @@ describe LogStash::Codecs::JSON do
|
|
16
16
|
data = {"foo" => "bar", "baz" => {"bah" => ["a","b","c"]}}
|
17
17
|
subject.decode(LogStash::Json.dump(data)) do |event|
|
18
18
|
insist { event.is_a? LogStash::Event }
|
19
|
-
insist { event
|
20
|
-
insist { event
|
21
|
-
insist { event
|
19
|
+
insist { event.get("foo") } == data["foo"]
|
20
|
+
insist { event.get("baz") } == data["baz"]
|
21
|
+
insist { event.get("bah") } == data["bah"]
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -47,8 +47,8 @@ describe LogStash::Codecs::JSON do
|
|
47
47
|
subject.decode("something that isn't json") do |event|
|
48
48
|
decoded = true
|
49
49
|
insist { event.is_a?(LogStash::Event) }
|
50
|
-
insist { event
|
51
|
-
insist { event
|
50
|
+
insist { event.get("message") } == "something that isn't json"
|
51
|
+
insist { event.get("tags") }.include?("_jsonparsefailure")
|
52
52
|
end
|
53
53
|
insist { decoded } == true
|
54
54
|
end
|
@@ -69,11 +69,11 @@ describe LogStash::Codecs::JSON do
|
|
69
69
|
end
|
70
70
|
|
71
71
|
it "should store the value in 'message'" do
|
72
|
-
expect(event
|
72
|
+
expect(event.get("message")).to eql(value_json)
|
73
73
|
end
|
74
74
|
|
75
75
|
it "should have the json parse failure tag" do
|
76
|
-
expect(event
|
76
|
+
expect(event.get("tags")).to include("_jsonparsefailure")
|
77
77
|
end
|
78
78
|
end
|
79
79
|
end
|
@@ -119,7 +119,7 @@ describe LogStash::Codecs::JSON do
|
|
119
119
|
subject.decode(blob) do |event|
|
120
120
|
decoded = true
|
121
121
|
insist { event.is_a?(LogStash::Event) }
|
122
|
-
insist { event
|
122
|
+
insist { event.get("message").encoding.to_s } == "UTF-8"
|
123
123
|
end
|
124
124
|
insist { decoded } == true
|
125
125
|
end
|
@@ -137,13 +137,13 @@ describe LogStash::Codecs::JSON do
|
|
137
137
|
|
138
138
|
it "uses an array to store the tags" do
|
139
139
|
subject.decode(message) do |event|
|
140
|
-
expect(event
|
140
|
+
expect(event.get('tags')).to be_a Array
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
144
144
|
it "add a json parser failure tag" do
|
145
145
|
subject.decode(message) do |event|
|
146
|
-
expect(event
|
146
|
+
expect(event.get('tags')).to include "_jsonparsefailure"
|
147
147
|
end
|
148
148
|
end
|
149
149
|
end
|
metadata
CHANGED
@@ -1,44 +1,46 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-codec-json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-core-plugin-api
|
15
|
-
version_requirements: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ~>
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.0'
|
20
15
|
requirement: !ruby/object:Gem::Requirement
|
21
16
|
requirements:
|
22
|
-
- - ~>
|
17
|
+
- - "~>"
|
23
18
|
- !ruby/object:Gem::Version
|
24
|
-
version: '
|
25
|
-
prerelease: false
|
19
|
+
version: '2.0'
|
26
20
|
type: :runtime
|
27
|
-
|
28
|
-
name: logstash-devutils
|
21
|
+
prerelease: false
|
29
22
|
version_requirements: !ruby/object:Gem::Requirement
|
30
23
|
requirements:
|
31
|
-
- -
|
24
|
+
- - "~>"
|
32
25
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: logstash-devutils
|
34
29
|
requirement: !ruby/object:Gem::Requirement
|
35
30
|
requirements:
|
36
|
-
- -
|
31
|
+
- - ">="
|
37
32
|
- !ruby/object:Gem::Version
|
38
33
|
version: '0'
|
39
|
-
prerelease: false
|
40
34
|
type: :development
|
41
|
-
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: This gem is a Logstash plugin required to be installed on top of the
|
42
|
+
Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This
|
43
|
+
gem is not a stand-alone program
|
42
44
|
email: info@elastic.co
|
43
45
|
executables: []
|
44
46
|
extensions: []
|
@@ -59,25 +61,26 @@ licenses:
|
|
59
61
|
metadata:
|
60
62
|
logstash_plugin: 'true'
|
61
63
|
logstash_group: codec
|
62
|
-
post_install_message:
|
64
|
+
post_install_message:
|
63
65
|
rdoc_options: []
|
64
66
|
require_paths:
|
65
67
|
- lib
|
66
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
67
69
|
requirements:
|
68
|
-
- -
|
70
|
+
- - ">="
|
69
71
|
- !ruby/object:Gem::Version
|
70
72
|
version: '0'
|
71
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
74
|
requirements:
|
73
|
-
- -
|
75
|
+
- - ">="
|
74
76
|
- !ruby/object:Gem::Version
|
75
77
|
version: '0'
|
76
78
|
requirements: []
|
77
|
-
rubyforge_project:
|
78
|
-
rubygems_version: 2.
|
79
|
-
signing_key:
|
79
|
+
rubyforge_project:
|
80
|
+
rubygems_version: 2.5.1
|
81
|
+
signing_key:
|
80
82
|
specification_version: 4
|
81
|
-
summary: This codec may be used to decode (via inputs) and encode (via outputs) full
|
83
|
+
summary: This codec may be used to decode (via inputs) and encode (via outputs) full
|
84
|
+
JSON messages
|
82
85
|
test_files:
|
83
86
|
- spec/codecs/json_spec.rb
|