logstash-codec-s3plain 2.0.6 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 891713a5ec6c73043666abf82d4aa6f64c7fb2a8
4
- data.tar.gz: 84e04292e832d8cca8c2c1aa2f4a3457f51f62c6
2
+ SHA256:
3
+ metadata.gz: 526b0e774aa22da2fd2ca1f2ca2bbe8bc16c1b0cb38d9a28add90d65b0cb2296
4
+ data.tar.gz: eb10efd6859ef9a03abe5c5bc16ad018bbb8ac1880bb26caeb7cb419f69c6f46
5
5
  SHA512:
6
- metadata.gz: 2b0613d12d513371fe887cc45ab8c1a4a89dc8ddd8120c448ac3e0a1078492b584c047e5fd64f72de224ce94e727035a55f5ca8325446b4d9bd64ea9c53fa383
7
- data.tar.gz: 5915b73785b713df7af5282fed79d8cc629108fb4e81ae8c035fe5ce62968a2c393e525bea3f0a402a903a9b6666a3bc76a37a29232187a0d328208937afc0cb
6
+ metadata.gz: 064b7206102ece8b9d4626feb337053abb169b7578028cdc499c828555c5665967154e8e2892b9c9dbf10f6e2e17791d2ce06070d569e1909db7cb9773f49d45
7
+ data.tar.gz: a84f9c6dee3f101e43ff0cf735086bbdac4850677aefcae1b6c843c6db5759edff7d6a2a2e483ee5cada4f39e3af0f564cfb3e83504b5478c22986207ffc74ba
@@ -1,3 +1,6 @@
1
+ ## 2.0.7
2
+ - Code cleanup. See https://github.com/logstash-plugins/logstash-codec-s3plain/pull/2
3
+
1
4
  ## 2.0.6
2
5
  - Fix some documentation issues
3
6
 
@@ -3,6 +3,7 @@ reports, or in general have helped logstash along its way.
3
3
 
4
4
  Contributors:
5
5
  * Pier-Hugues Pellerin (ph)
6
+ * Colin Surprenant (colinsurprenant)
6
7
 
7
8
  Note: If you've sent us patches, bug reports, or otherwise contributed to
8
9
  Logstash, and you aren't on the list above and want to be, please let us know
@@ -7,24 +7,21 @@ require "logstash/util/charset"
7
7
  class LogStash::Codecs::S3Plain < LogStash::Codecs::Base
8
8
  config_name "s3_plain"
9
9
 
10
- public
10
+ SOURCE_FIELD = "source".freeze
11
+ TAGS_FIELD = "tags".freeze
12
+ MESSAGE_FIELD = "message".freeze
13
+
11
14
  def decode(data)
12
15
  raise RuntimeError.new("This codec is only used for backward compatibility with the previous S3 output.")
13
- end # def decode
16
+ end
14
17
 
15
- public
16
18
  def encode(event)
17
- if event.is_a?(LogStash::Event)
18
-
19
- message = "Date: #{event[LogStash::Event::TIMESTAMP]}\n"
20
- message << "Source: #{event["source"]}\n"
21
- message << "Tags: #{Array(event["tags"]).join(', ')}\n"
22
- message << "Fields: #{event.to_hash.inspect}\n"
23
- message << "Message: #{event["message"]}"
19
+ message = "Date: #{event.get(LogStash::Event::TIMESTAMP)}\n"
20
+ message << "Source: #{event.get(SOURCE_FIELD)}\n"
21
+ message << "Tags: #{Array(event.get(TAGS_FIELD)).join(', ')}\n"
22
+ message << "Fields: #{event.to_hash.inspect}\n"
23
+ message << "Message: #{event.get(MESSAGE_FIELD)}"
24
24
 
25
- @on_event.call(message)
26
- else
27
- @on_event.call(event.to_s)
28
- end
29
- end # def encode
30
- end # class LogStash::Codecs::S3Plain
25
+ @on_event.call(message)
26
+ end
27
+ end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-codec-s3plain'
4
- s.version = '2.0.6'
4
+ s.version = '2.0.7'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "This codec may be used to encode (via outputs) S3plain text format, this make the S3 outputs backward compatible with Logstash 1.4.2"
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"
@@ -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", "~> 1.0"
23
+ s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
24
24
  s.add_runtime_dependency 'logstash-devutils'
25
25
  end
26
26
 
@@ -9,7 +9,7 @@ describe LogStash::Codecs::S3Plain do
9
9
  describe "#encode" do
10
10
  it 'should accept a nil list for the tags' do
11
11
  subject.on_event do |data|
12
- data.should match(/\nTags:\s\n/)
12
+ expect(data).to match(/\nTags:\s\n/)
13
13
  end
14
14
 
15
15
  subject.encode(LogStash::Event.new)
@@ -19,20 +19,10 @@ describe LogStash::Codecs::S3Plain do
19
19
  event = LogStash::Event.new({"tags" => ["elasticsearch", "logstash", "kibana"] })
20
20
 
21
21
  subject.on_event do |data|
22
- data.should match(/\nTags:\selasticsearch,\slogstash,\skibana\n/)
22
+ expect(data).to match(/\nTags:\selasticsearch,\slogstash,\skibana\n/)
23
23
  end
24
24
 
25
25
  subject.encode(event)
26
26
  end
27
-
28
- it "return to_s if its not LogStash::Event" do
29
- event = {"test" => "A-B-C" }
30
-
31
- subject.on_event do |data|
32
- data.should == event.to_s
33
- end
34
-
35
- subject.encode(event)
36
- end
37
- end
27
+ end
38
28
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-codec-s3plain
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.6
4
+ version: 2.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-15 00:00:00.000000000 Z
11
+ date: 2017-12-19 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
+ - !ruby/object:Gem::Version
18
+ version: '1.60'
19
+ - - "<="
17
20
  - !ruby/object:Gem::Version
18
- version: '1.0'
21
+ version: '2.99'
19
22
  name: logstash-core-plugin-api
20
23
  prerelease: false
21
24
  type: :runtime
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '1.60'
30
+ - - "<="
25
31
  - !ruby/object:Gem::Version
26
- version: '1.0'
32
+ version: '2.99'
27
33
  - !ruby/object:Gem::Dependency
28
34
  requirement: !ruby/object:Gem::Requirement
29
35
  requirements:
@@ -38,7 +44,9 @@ dependencies:
38
44
  - - ">="
39
45
  - !ruby/object:Gem::Version
40
46
  version: '0'
41
- 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
47
+ description: This gem is a Logstash plugin required to be installed on top of the
48
+ Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This
49
+ gem is not a stand-alone program
42
50
  email: info@elastic.co
43
51
  executables: []
44
52
  extensions: []
@@ -76,9 +84,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
84
  version: '0'
77
85
  requirements: []
78
86
  rubyforge_project:
79
- rubygems_version: 2.4.8
87
+ rubygems_version: 2.6.13
80
88
  signing_key:
81
89
  specification_version: 4
82
- summary: This codec may be used to encode (via outputs) S3plain text format, this make the S3 outputs backward compatible with Logstash 1.4.2
90
+ summary: This codec may be used to encode (via outputs) S3plain text format, this
91
+ make the S3 outputs backward compatible with Logstash 1.4.2
83
92
  test_files:
84
93
  - spec/codecs/s3_plain_spec.rb