logstash-input-journald 1.0.0 → 2.0.0

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
  SHA1:
3
- metadata.gz: 8a823fda0053e3ac96195d8d1e2bb2ee41c0f343
4
- data.tar.gz: 7dc560225810be73ed346ab21a9217f4c65c7ef5
3
+ metadata.gz: e66e7ea2ac0e27fa72d0afa56f1155a4a35cb100
4
+ data.tar.gz: '058578d043dd4dd5c73c05b079ac43ecea0a345c'
5
5
  SHA512:
6
- metadata.gz: 7d1a2dac2b9d4b295d3e0bc34a2d41dd61c92b8b9410adea5cac0ebd75ae344884bf866bb63ec182cc2f9fb0142149fe8bf38e6b2f6c0b9313fe659c0795a2c4
7
- data.tar.gz: b52526af560c8650d77a5f3b53bdb9233958ae346311401ea79fb4edefe866af83e41a4cf11c475f56099ea6f4ac8e3b1f4c67cd9f9cb26b3f48aa69eb945749
6
+ metadata.gz: f144034ee78d5313f08fa92d86fc55b2fdd4f362118edead14af7b45e2ce008303f0f49d01cdddacd76a7b1f480838888a322e55275661b986a571652ee569a7
7
+ data.tar.gz: 16356621025d6c0c56670499c187c1acd21e03e7be77c981facf3e46bcdea6127c7cce7ed5d77bf72c821b7fbd62b0624d4e8a8a6eb23c974051dacb6293b487
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ ## 3.0.0
2
+ - Breaking: Updated plugin to use new Java Event APIs
3
+ - relax logstash-core-plugin-api constrains
4
+ - update .travis.yml
@@ -4,6 +4,7 @@ require "logstash/namespace"
4
4
  require "socket"
5
5
  require "systemd/journal"
6
6
  require "fileutils" # For touch
7
+ require "base64"
7
8
 
8
9
  # Pull events from a local systemd journal.
9
10
  #
@@ -165,9 +166,23 @@ module Systemd
165
166
  class JournalEntry
166
167
  def to_h_lower(is_lowercase)
167
168
  if is_lowercase
168
- @entry.each_with_object({}) { |(k, v), h| h[k.downcase] = v.dup.force_encoding('iso-8859-1').encode('utf-8') }
169
+ @entry.each_with_object({}) { |(k, v), h| h[k.downcase] = decode_value(v.dup) }
169
170
  else
170
- @entry.each_with_object({}) { |(k, v), h| h[k] = v.dup.force_encoding('iso-8859-1').encode('utf-8') }
171
+ @entry.each_with_object({}) { |(k, v), h| h[k] = decode_value(v.dup) }
172
+ end
173
+ end
174
+
175
+ # Field values are returned as binary (ASCII-8BIT) by the journal API.
176
+ # The officially recommended encoding is UTF-8, so trying that.
177
+ # If the result is not valid, using base64 representation instead.
178
+ # (see https://www.freedesktop.org/software/systemd/man/sd_journal_print.html#Description)
179
+ private
180
+ def decode_value(value)
181
+ value_utf8 = value.force_encoding('utf-8')
182
+ if value_utf8.valid_encoding?
183
+ value_utf8
184
+ else
185
+ Base64.encode64(value)
171
186
  end
172
187
  end
173
188
  end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-journald'
4
- s.version = '1.0.0'
4
+ s.version = '2.0.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Read events from local systemd journal"
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" => "input" }
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
 
25
25
  s.add_runtime_dependency 'logstash-codec-plain'
26
26
  s.add_runtime_dependency 'logstash-codec-line'
metadata CHANGED
@@ -1,133 +1,142 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-journald
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - stuart-warren
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-23 00:00:00.000000000 Z
11
+ date: 2016-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: logstash-core-plugin-api
14
15
  requirement: !ruby/object:Gem::Requirement
15
16
  requirements:
16
- - - ~>
17
+ - - ">="
17
18
  - !ruby/object:Gem::Version
18
- version: '1.0'
19
- name: logstash-core-plugin-api
20
- prerelease: false
19
+ version: '1.60'
20
+ - - "<="
21
+ - !ruby/object:Gem::Version
22
+ version: '2.99'
21
23
  type: :runtime
24
+ prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - ~>
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: '1.0'
29
+ version: '1.60'
30
+ - - "<="
31
+ - !ruby/object:Gem::Version
32
+ version: '2.99'
27
33
  - !ruby/object:Gem::Dependency
34
+ name: logstash-codec-plain
28
35
  requirement: !ruby/object:Gem::Requirement
29
36
  requirements:
30
- - - '>='
37
+ - - ">="
31
38
  - !ruby/object:Gem::Version
32
39
  version: '0'
33
- name: logstash-codec-plain
34
- prerelease: false
35
40
  type: :runtime
41
+ prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
- - - '>='
44
+ - - ">="
39
45
  - !ruby/object:Gem::Version
40
46
  version: '0'
41
47
  - !ruby/object:Gem::Dependency
48
+ name: logstash-codec-line
42
49
  requirement: !ruby/object:Gem::Requirement
43
50
  requirements:
44
- - - '>='
51
+ - - ">="
45
52
  - !ruby/object:Gem::Version
46
53
  version: '0'
47
- name: logstash-codec-line
48
- prerelease: false
49
54
  type: :runtime
55
+ prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
- - - '>='
58
+ - - ">="
53
59
  - !ruby/object:Gem::Version
54
60
  version: '0'
55
61
  - !ruby/object:Gem::Dependency
62
+ name: logstash-codec-json
56
63
  requirement: !ruby/object:Gem::Requirement
57
64
  requirements:
58
- - - '>='
65
+ - - ">="
59
66
  - !ruby/object:Gem::Version
60
67
  version: '0'
61
- name: logstash-codec-json
62
- prerelease: false
63
68
  type: :runtime
69
+ prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
- - - '>='
72
+ - - ">="
67
73
  - !ruby/object:Gem::Version
68
74
  version: '0'
69
75
  - !ruby/object:Gem::Dependency
76
+ name: logstash-codec-json_lines
70
77
  requirement: !ruby/object:Gem::Requirement
71
78
  requirements:
72
- - - '>='
79
+ - - ">="
73
80
  - !ruby/object:Gem::Version
74
81
  version: '0'
75
- name: logstash-codec-json_lines
76
- prerelease: false
77
82
  type: :runtime
83
+ prerelease: false
78
84
  version_requirements: !ruby/object:Gem::Requirement
79
85
  requirements:
80
- - - '>='
86
+ - - ">="
81
87
  - !ruby/object:Gem::Version
82
88
  version: '0'
83
89
  - !ruby/object:Gem::Dependency
90
+ name: ffi
84
91
  requirement: !ruby/object:Gem::Requirement
85
92
  requirements:
86
- - - '>='
93
+ - - ">="
87
94
  - !ruby/object:Gem::Version
88
95
  version: '0'
89
- name: ffi
90
- prerelease: false
91
96
  type: :runtime
97
+ prerelease: false
92
98
  version_requirements: !ruby/object:Gem::Requirement
93
99
  requirements:
94
- - - '>='
100
+ - - ">="
95
101
  - !ruby/object:Gem::Version
96
102
  version: '0'
97
103
  - !ruby/object:Gem::Dependency
104
+ name: systemd-journal
98
105
  requirement: !ruby/object:Gem::Requirement
99
106
  requirements:
100
- - - ~>
107
+ - - "~>"
101
108
  - !ruby/object:Gem::Version
102
109
  version: 1.2.2
103
- name: systemd-journal
104
- prerelease: false
105
110
  type: :runtime
111
+ prerelease: false
106
112
  version_requirements: !ruby/object:Gem::Requirement
107
113
  requirements:
108
- - - ~>
114
+ - - "~>"
109
115
  - !ruby/object:Gem::Version
110
116
  version: 1.2.2
111
117
  - !ruby/object:Gem::Dependency
118
+ name: logstash-devutils
112
119
  requirement: !ruby/object:Gem::Requirement
113
120
  requirements:
114
- - - '>='
121
+ - - ">="
115
122
  - !ruby/object:Gem::Version
116
123
  version: '0'
117
- name: logstash-devutils
118
- prerelease: false
119
124
  type: :development
125
+ prerelease: false
120
126
  version_requirements: !ruby/object:Gem::Requirement
121
127
  requirements:
122
- - - '>='
128
+ - - ">="
123
129
  - !ruby/object:Gem::Version
124
130
  version: '0'
125
- 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
131
+ description: This gem is a Logstash plugin required to be installed on top of the
132
+ Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This
133
+ gem is not a stand-alone program
126
134
  email: stuart.warren@ocado.com
127
135
  executables: []
128
136
  extensions: []
129
137
  extra_rdoc_files: []
130
138
  files:
139
+ - CHANGELOG.md
131
140
  - Gemfile
132
141
  - LICENSE
133
142
  - README.md
@@ -140,24 +149,24 @@ licenses:
140
149
  metadata:
141
150
  logstash_plugin: 'true'
142
151
  logstash_group: input
143
- post_install_message:
152
+ post_install_message:
144
153
  rdoc_options: []
145
154
  require_paths:
146
155
  - lib
147
156
  required_ruby_version: !ruby/object:Gem::Requirement
148
157
  requirements:
149
- - - '>='
158
+ - - ">="
150
159
  - !ruby/object:Gem::Version
151
160
  version: '0'
152
161
  required_rubygems_version: !ruby/object:Gem::Requirement
153
162
  requirements:
154
- - - '>='
163
+ - - ">="
155
164
  - !ruby/object:Gem::Version
156
165
  version: '0'
157
166
  requirements: []
158
- rubyforge_project:
159
- rubygems_version: 2.4.5
160
- signing_key:
167
+ rubyforge_project:
168
+ rubygems_version: 2.5.2
169
+ signing_key:
161
170
  specification_version: 4
162
171
  summary: Read events from local systemd journal
163
172
  test_files: