logstash-codec-msgpack 2.0.4-java → 3.0.1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +3 -1
- data/LICENSE +1 -1
- data/README.md +12 -3
- data/lib/logstash/codecs/msgpack.rb +13 -5
- data/logstash-codec-msgpack.gemspec +3 -3
- data/spec/codecs/msgpack_spec.rb +6 -6
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 839141202e9a958449e8399ed25082343b78c84b
|
4
|
+
data.tar.gz: 3a06461dc92da66000197bbef8164b72e69f7b9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1728c77321d09f6acb7ec5dac1592756742a8b76839b585ee894b624c7efd25af170d90fd6781cf659953c0363cb5967891e2229634cf928432010ec4990367
|
7
|
+
data.tar.gz: 4e5ca7228fda4f6d842ff00e82da97a1101b596b0c46f559a88048870dcc8f90d1d9bb199603d67284134f79000733f00b228bc60a5741cf5a64d920efffd130
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 3.0.1
|
2
|
+
- Republish all the gems under jruby.
|
3
|
+
## 3.0.0
|
4
|
+
- 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
5
|
# 2.0.4
|
2
6
|
- Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
|
3
7
|
# 2.0.3
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# Logstash Plugin
|
2
2
|
|
3
|
-
[![Build
|
4
|
-
Status](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Codecs/job/logstash-plugin-codec-msgpack-unit/badge/icon)](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Codecs/job/logstash-plugin-codec-msgpack-unit/)
|
3
|
+
[![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-codec-msgpack.svg)](https://travis-ci.org/logstash-plugins/logstash-codec-msgpack)
|
5
4
|
|
6
5
|
This is a plugin for [Logstash](https://github.com/elastic/logstash).
|
7
6
|
|
@@ -56,7 +55,12 @@ gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
|
|
56
55
|
```
|
57
56
|
- Install plugin
|
58
57
|
```sh
|
58
|
+
# Logstash 2.3 and higher
|
59
|
+
bin/logstash-plugin install --no-verify
|
60
|
+
|
61
|
+
# Prior to Logstash 2.3
|
59
62
|
bin/plugin install --no-verify
|
63
|
+
|
60
64
|
```
|
61
65
|
- Run Logstash with your plugin
|
62
66
|
```sh
|
@@ -74,7 +78,12 @@ gem build logstash-filter-awesome.gemspec
|
|
74
78
|
```
|
75
79
|
- Install the plugin from the Logstash home
|
76
80
|
```sh
|
77
|
-
|
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
|
+
|
78
87
|
```
|
79
88
|
- Start Logstash and proceed to test the plugin
|
80
89
|
|
@@ -19,17 +19,25 @@ class LogStash::Codecs::Msgpack < LogStash::Codecs::Base
|
|
19
19
|
begin
|
20
20
|
# Msgpack does not care about UTF-8
|
21
21
|
event = LogStash::Event.new(MessagePack.unpack(data))
|
22
|
-
|
22
|
+
|
23
|
+
if event.get("tags").nil?
|
24
|
+
event.set("tags", [])
|
25
|
+
end
|
26
|
+
|
23
27
|
if @format
|
24
|
-
event
|
28
|
+
if event.get("message").nil?
|
29
|
+
event.set("message", event.sprintf(@format))
|
30
|
+
end
|
25
31
|
end
|
26
32
|
rescue => e
|
27
33
|
# Treat as plain text and try to do the best we can with it?
|
28
34
|
@logger.warn("Trouble parsing msgpack input, falling back to plain text",
|
29
35
|
:input => data, :exception => e)
|
30
|
-
event
|
31
|
-
|
32
|
-
event
|
36
|
+
event.set("message", data)
|
37
|
+
|
38
|
+
tags = event.get("tags").nil? ? [] : event.get("tags")
|
39
|
+
tags << "_msgpackparsefailure"
|
40
|
+
event.set("tags", tags)
|
33
41
|
end
|
34
42
|
yield event
|
35
43
|
end # def decode
|
@@ -1,10 +1,10 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-codec-msgpack'
|
4
|
-
s.version = '
|
4
|
+
s.version = '3.0.1'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Encode and decode msgpack formatted data"
|
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
|
if RUBY_PLATFORM == "java"
|
26
26
|
s.platform = RUBY_PLATFORM
|
data/spec/codecs/msgpack_spec.rb
CHANGED
@@ -14,10 +14,10 @@ describe LogStash::Codecs::Msgpack do
|
|
14
14
|
data = {"foo" => "bar", "baz" => {"bah" => ["a","b","c"]}, "@timestamp" => "2014-05-30T02:52:17.929Z"}
|
15
15
|
subject.decode(MessagePack.pack(data)) do |event|
|
16
16
|
insist { event.is_a? LogStash::Event }
|
17
|
-
insist { event
|
18
|
-
insist { event
|
19
|
-
insist { event
|
20
|
-
insist { event
|
17
|
+
insist { event.get("foo") } == data["foo"]
|
18
|
+
insist { event.get("baz") } == data["baz"]
|
19
|
+
insist { event.get("bah") } == data["bah"]
|
20
|
+
insist { event.get("@timestamp").to_iso8601 } == data["@timestamp"]
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -32,7 +32,7 @@ describe LogStash::Codecs::Msgpack do
|
|
32
32
|
insist { MessagePack.unpack(d)["baz"] } == data["baz"]
|
33
33
|
insist { MessagePack.unpack(d)["bah"] } == data["bah"]
|
34
34
|
insist { MessagePack.unpack(d)["@timestamp"] } == "2014-05-30T02:52:17.929Z"
|
35
|
-
insist { MessagePack.unpack(d)["@timestamp"] } == event
|
35
|
+
insist { MessagePack.unpack(d)["@timestamp"] } == event.get("@timestamp").to_iso8601
|
36
36
|
got_event = true
|
37
37
|
end
|
38
38
|
subject.encode(event)
|
@@ -48,7 +48,7 @@ describe LogStash::Codecs::Msgpack do
|
|
48
48
|
insist { MessagePack.unpack(d)["baz"] } == data["baz"]
|
49
49
|
insist { MessagePack.unpack(d)["bah"] } == data["bah"]
|
50
50
|
insist { MessagePack.unpack(d)["@timestamp"] } == "2014-05-30T02:52:17.929Z"
|
51
|
-
insist { MessagePack.unpack(d)["@timestamp"] } == event
|
51
|
+
insist { MessagePack.unpack(d)["@timestamp"] } == event.get("@timestamp").to_iso8601
|
52
52
|
got_event = true
|
53
53
|
end
|
54
54
|
subject.encode(event)
|
metadata
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-codec-msgpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.1
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
16
|
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: '
|
18
|
+
version: '2.0'
|
19
19
|
name: logstash-core-plugin-api
|
20
20
|
prerelease: false
|
21
21
|
type: :runtime
|
@@ -23,7 +23,7 @@ dependencies:
|
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
description: This gem is a
|
55
|
+
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
|
56
56
|
email: info@elastic.co
|
57
57
|
executables: []
|
58
58
|
extensions: []
|