logstash-codec-plain 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf26b889810da44bf0bb4deb8a3365dcf1489d6ed9d791c11f6595addfbf4930
4
- data.tar.gz: 64d0880c3709cfe2384926f82c8cd5a460702f6b245224ed5c4a9bf371d3b028
3
+ metadata.gz: f48578a738eee4ed2dc36bdec0b4498f5e4feaebdc3fc30140b0480b5fa5f192
4
+ data.tar.gz: e9f2fa6a67d8430a99507ff654e27246eaba4f10956352f1accb701d895fe18d
5
5
  SHA512:
6
- metadata.gz: 40ca998c61a93f18ab401c6e3480ee483f481a2e023432ea3866b82a53c1b72458c692ced707c8ffa8643dead627f945219eea9f8a9951377b1077f1aaa49faf
7
- data.tar.gz: 1c015168708d4b742706294796793dcd5b5b303a08f5b3316826022a5bcf527cacdfc59e5421b64bb49d922a57776a55b433d5e0828ccd8eb88e2d706a34a44e
6
+ metadata.gz: 55201fbc5671a3bdb4cf2017ebce584c2197c1974ca116964b9f7ce06ea8381b5562a7a8e4ad5cb580cdb811727fa850426301b737110e1b22d526f9d53e8a14
7
+ data.tar.gz: 378e1b68220c42c84151e085573a6f7cdf3843fa6f0a2adb53ff10bb48124f206c1d9c7d27dcd8d5402ae99efce13f9d0b5adadb6f362e9fe3941f4f32410e6b
@@ -1,3 +1,6 @@
1
+ ## 3.0.6
2
+ - Code cleanup. See https://github.com/logstash-plugins/logstash-codec-plain/pull/6
3
+
1
4
  ## 3.0.5
2
5
  - Update gemspec summary
3
6
 
@@ -24,24 +24,19 @@ class LogStash::Codecs::Plain < LogStash::Codecs::Base
24
24
  # This only affects "plain" format logs since json is `UTF-8` already.
25
25
  config :charset, :validate => ::Encoding.name_list, :default => "UTF-8"
26
26
 
27
- public
27
+ MESSAGE_FIELD = "message".freeze
28
+
28
29
  def register
29
30
  @converter = LogStash::Util::Charset.new(@charset)
30
31
  @converter.logger = @logger
31
32
  end
32
33
 
33
- public
34
34
  def decode(data)
35
- yield LogStash::Event.new("message" => @converter.convert(data))
36
- end # def decode
35
+ yield LogStash::Event.new(MESSAGE_FIELD => @converter.convert(data))
36
+ end
37
37
 
38
- public
39
38
  def encode(event)
40
- if event.is_a?(LogStash::Event) and @format
41
- @on_event.call(event, event.sprintf(@format))
42
- else
43
- @on_event.call(event, event.to_s)
44
- end
45
- end # def encode
46
-
47
- end # class LogStash::Codecs::Plain
39
+ encoded = @format ? event.sprintf(@format) : event.to_s
40
+ @on_event.call(event, encoded)
41
+ end
42
+ end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-codec-plain'
4
- s.version = '3.0.5'
4
+ s.version = '3.0.6'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Reads plaintext with no delimiting between events"
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"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-codec-plain
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.5
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: 2017-11-07 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
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  version: '0'
85
85
  requirements: []
86
86
  rubyforge_project:
87
- rubygems_version: 2.6.11
87
+ rubygems_version: 2.6.13
88
88
  signing_key:
89
89
  specification_version: 4
90
90
  summary: Reads plaintext with no delimiting between events