fluentd 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fluentd might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.travis.yml +4 -2
- data/CHANGELOG.md +16 -0
- data/fluentd.gemspec +1 -1
- data/lib/fluent/log.rb +1 -1
- data/lib/fluent/plugin/base.rb +6 -0
- data/lib/fluent/plugin/buf_file.rb +1 -1
- data/lib/fluent/plugin/parser_syslog.rb +18 -1
- data/lib/fluent/plugin_helper/server.rb +1 -1
- data/lib/fluent/version.rb +1 -1
- data/test/command/test_fluentd.rb +1 -1
- data/test/plugin/test_parser_syslog.rb +49 -0
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e5a7a4c71fe45e0a65fd941bea4093e8a6c5414
|
4
|
+
data.tar.gz: 6e4000e2928c6bfda990ea5566e4e32618e031f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94194178c70c31f9ae8f20f4c85230f1479f53dfbd25e5e8a13e724a5cf8ca7b38a7658a97153838ff486d554d0f44369bf2f622838af324c585594a3748d76d
|
7
|
+
data.tar.gz: 836807eb180ed4144f8333cb67c11d640b432882497e63d24d760a7a050f4513e137b6ac97bc6503d781e5690e80e26dee25792e6081b99f857f40787256e029
|
data/.travis.yml
CHANGED
@@ -11,12 +11,14 @@ matrix:
|
|
11
11
|
os: linux
|
12
12
|
- rvm: 2.2.10
|
13
13
|
os: linux
|
14
|
-
- rvm: 2.3.
|
14
|
+
- rvm: 2.3.7
|
15
15
|
os: linux
|
16
16
|
- rvm: 2.4.5
|
17
17
|
os: linux
|
18
18
|
- rvm: 2.5.3
|
19
19
|
os: linux
|
20
|
+
- rvm: 2.6.0
|
21
|
+
os: linux
|
20
22
|
- rvm: ruby-head
|
21
23
|
os: linux
|
22
24
|
- rvm: 2.1.10
|
@@ -50,7 +52,7 @@ branches:
|
|
50
52
|
- v0.14
|
51
53
|
|
52
54
|
before_install:
|
53
|
-
- gem update --system
|
55
|
+
- gem update --system=2.7.8
|
54
56
|
|
55
57
|
sudo: false
|
56
58
|
dist: trusty # for TLSv1.2 support
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# v1.3
|
2
2
|
|
3
|
+
## Release v1.3.3 - 2018/01/06
|
4
|
+
|
5
|
+
### Enhancements
|
6
|
+
|
7
|
+
* parser_syslog: Use String#squeeze for performance improvement
|
8
|
+
https://github.com/fluent/fluentd/pull/2239
|
9
|
+
* parser_syslog: Support RFC5424 timestamp without subseconds
|
10
|
+
https://github.com/fluent/fluentd/pull/2240
|
11
|
+
|
12
|
+
### Bug fixes
|
13
|
+
|
14
|
+
* server: Ignore ECONNRESET in TLS accept to avoid fluentd restart
|
15
|
+
https://github.com/fluent/fluentd/pull/2243
|
16
|
+
* log: Fix plugin logger ignores fluentd log event setting
|
17
|
+
https://github.com/fluent/fluentd/pull/2252
|
18
|
+
|
3
19
|
## Release v1.3.2 - 2018/12/10
|
4
20
|
|
5
21
|
### Enhancements
|
data/fluentd.gemspec
CHANGED
@@ -47,5 +47,5 @@ Gem::Specification.new do |gem|
|
|
47
47
|
gem.add_development_dependency("timecop", ["~> 0.3"])
|
48
48
|
gem.add_development_dependency("test-unit", ["~> 3.2"])
|
49
49
|
gem.add_development_dependency("test-unit-rr", ["~> 1.0"])
|
50
|
-
gem.add_development_dependency("oj", ["
|
50
|
+
gem.add_development_dependency("oj", [">= 2.14", "< 4"])
|
51
51
|
end
|
data/lib/fluent/log.rb
CHANGED
@@ -554,7 +554,7 @@ module Fluent
|
|
554
554
|
|
555
555
|
extend Forwardable
|
556
556
|
def_delegators '@logger', :get_worker_id, :enable_color?, :enable_debug, :enable_event,
|
557
|
-
:disable_events, :log_event_enabled, :
|
557
|
+
:disable_events, :log_event_enabled, :log_event_enabled=, :time_format, :time_format=,
|
558
558
|
:time_formatter, :time_formatter=, :event, :caller_line, :puts, :write, :<<, :flush,
|
559
559
|
:reset, :out, :out=, :optional_header, :optional_header=, :optional_attrs, :optional_attrs=
|
560
560
|
end
|
data/lib/fluent/plugin/base.rb
CHANGED
@@ -81,6 +81,12 @@ module Fluent
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def start
|
84
|
+
# By initialization order, plugin logger is created before set log_event_enabled.
|
85
|
+
# It causes '@id' specified plugin, it uses plugin logger instead of global logger, ignores `<label @FLUENT_LOG>` setting.
|
86
|
+
# This is adhoc approach but impact is minimal.
|
87
|
+
if @log.is_a?(Fluent::PluginLogger) && $log.respond_to?(:log_event_enabled) # log_event_enabled check for tests
|
88
|
+
@log.log_event_enabled = $log.log_event_enabled
|
89
|
+
end
|
84
90
|
@_state.start = true
|
85
91
|
self
|
86
92
|
end
|
@@ -137,7 +137,7 @@ module Fluent
|
|
137
137
|
# so it should not added into @metadata_list for now
|
138
138
|
mode = Fluent::Plugin::Buffer::FileChunk.assume_chunk_state(path)
|
139
139
|
if mode == :unknown
|
140
|
-
log.debug "
|
140
|
+
log.debug "unknown state chunk found", path: path
|
141
141
|
next
|
142
142
|
end
|
143
143
|
|
@@ -48,6 +48,8 @@ module Fluent
|
|
48
48
|
super
|
49
49
|
|
50
50
|
@time_parser_rfc3164 = @time_parser_rfc5424 = nil
|
51
|
+
@time_parser_rfc5424_without_subseconds = nil
|
52
|
+
@support_rfc5424_without_subseconds = false
|
51
53
|
@regexp = case @message_format
|
52
54
|
when :rfc3164
|
53
55
|
class << self
|
@@ -59,6 +61,7 @@ module Fluent
|
|
59
61
|
alias_method :parse, :parse_plain
|
60
62
|
end
|
61
63
|
@time_format = @rfc5424_time_format unless conf.has_key?('time_format')
|
64
|
+
@support_rfc5424_without_subseconds = true
|
62
65
|
@with_priority ? REGEXP_RFC5424_WITH_PRI : REGEXP_RFC5424
|
63
66
|
when :auto
|
64
67
|
class << self
|
@@ -69,6 +72,7 @@ module Fluent
|
|
69
72
|
nil
|
70
73
|
end
|
71
74
|
@time_parser = time_parser_create
|
75
|
+
@time_parser_rfc5424_without_subseconds = time_parser_create(format: "%Y-%m-%dT%H:%M:%S%z")
|
72
76
|
end
|
73
77
|
|
74
78
|
def patterns
|
@@ -83,6 +87,7 @@ module Fluent
|
|
83
87
|
if REGEXP_DETECT_RFC5424.match(text)
|
84
88
|
@regexp = @with_priority ? REGEXP_RFC5424_WITH_PRI : REGEXP_RFC5424
|
85
89
|
@time_parser = @time_parser_rfc5424
|
90
|
+
@support_rfc5424_without_subseconds = true
|
86
91
|
else
|
87
92
|
@regexp = @with_priority ? REGEXP_WITH_PRI : REGEXP
|
88
93
|
@time_parser = @time_parser_rfc3164
|
@@ -106,7 +111,19 @@ module Fluent
|
|
106
111
|
when "pri"
|
107
112
|
record['pri'] = value.to_i
|
108
113
|
when "time"
|
109
|
-
time = @mutex.synchronize
|
114
|
+
time = @mutex.synchronize do
|
115
|
+
time_str = value.squeeze(' ')
|
116
|
+
begin
|
117
|
+
@time_parser.parse(time_str)
|
118
|
+
rescue Fluent::TimeParser::TimeParseError => e
|
119
|
+
if @support_rfc5424_without_subseconds
|
120
|
+
log.trace(e)
|
121
|
+
@time_parser_rfc5424_without_subseconds.parse(time_str)
|
122
|
+
else
|
123
|
+
raise
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
110
127
|
record[name] = value if @keep_time_key
|
111
128
|
else
|
112
129
|
record[name] = value
|
data/lib/fluent/version.rb
CHANGED
@@ -442,7 +442,7 @@ CONF
|
|
442
442
|
|
443
443
|
assert_fluentd_fails_to_start(
|
444
444
|
create_cmdline(conf_path, "-p", File.dirname(plugin_path)),
|
445
|
-
"in_buggy.rb:5: syntax error, unexpected end-of-input, expecting
|
445
|
+
"in_buggy.rb:5: syntax error, unexpected end-of-input, expecting"
|
446
446
|
)
|
447
447
|
end
|
448
448
|
end
|
@@ -232,6 +232,44 @@ class SyslogParserTest < ::Test::Unit::TestCase
|
|
232
232
|
assert_nil record["message"]
|
233
233
|
end
|
234
234
|
end
|
235
|
+
|
236
|
+
def test_parse_with_rfc5424_message_without_subseconds
|
237
|
+
@parser.configure(
|
238
|
+
'message_format' => 'rfc5424',
|
239
|
+
'with_priority' => true,
|
240
|
+
)
|
241
|
+
text = '<16>1 2017-02-06T13:14:15Z 192.168.0.1 fluentd - - - Hi, from Fluentd!'
|
242
|
+
@parser.instance.parse(text) do |time, record|
|
243
|
+
assert_equal(event_time("2017-02-06T13:14:15Z", format: '%Y-%m-%dT%H:%M:%S%z'), time)
|
244
|
+
assert_equal "-", record["pid"]
|
245
|
+
assert_equal "-", record["msgid"]
|
246
|
+
assert_equal "-", record["extradata"]
|
247
|
+
assert_equal "Hi, from Fluentd!", record["message"]
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
def test_parse_with_rfc5424_message_both_timestamp
|
252
|
+
@parser.configure(
|
253
|
+
'message_format' => 'rfc5424',
|
254
|
+
'with_priority' => true,
|
255
|
+
)
|
256
|
+
text = '<16>1 2017-02-06T13:14:15Z 192.168.0.1 fluentd - - - Hi, from Fluentd!'
|
257
|
+
@parser.instance.parse(text) do |time, record|
|
258
|
+
assert_equal(event_time("2017-02-06T13:14:15Z", format: '%Y-%m-%dT%H:%M:%S%z'), time)
|
259
|
+
assert_equal "-", record["pid"]
|
260
|
+
assert_equal "-", record["msgid"]
|
261
|
+
assert_equal "-", record["extradata"]
|
262
|
+
assert_equal "Hi, from Fluentd!", record["message"]
|
263
|
+
end
|
264
|
+
text = '<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd - - - Hi, from Fluentd with subseconds!'
|
265
|
+
@parser.instance.parse(text) do |time, record|
|
266
|
+
assert_equal(event_time("2017-02-06T13:14:15.003Z", format: '%Y-%m-%dT%H:%M:%S.%L%z'), time)
|
267
|
+
assert_equal "-", record["pid"]
|
268
|
+
assert_equal "-", record["msgid"]
|
269
|
+
assert_equal "-", record["extradata"]
|
270
|
+
assert_equal "Hi, from Fluentd with subseconds!", record["message"]
|
271
|
+
end
|
272
|
+
end
|
235
273
|
end
|
236
274
|
|
237
275
|
class TestAutoRegexp < self
|
@@ -387,6 +425,17 @@ class SyslogParserTest < ::Test::Unit::TestCase
|
|
387
425
|
end
|
388
426
|
assert_equal(Fluent::Plugin::SyslogParser::REGEXP_RFC5424_WITH_PRI,
|
389
427
|
@parser.instance.patterns['format'])
|
428
|
+
|
429
|
+
text = '<16>1 2017-02-06T13:14:15Z 192.168.0.1 fluentd - - - Hi, from Fluentd without subseconds!'
|
430
|
+
@parser.instance.parse(text) do |time, record|
|
431
|
+
assert_equal(event_time("2017-02-06T13:14:15Z", format: '%Y-%m-%dT%H:%M:%S%z'), time)
|
432
|
+
assert_equal "-", record["pid"]
|
433
|
+
assert_equal "-", record["msgid"]
|
434
|
+
assert_equal "-", record["extradata"]
|
435
|
+
assert_equal "Hi, from Fluentd without subseconds!", record["message"]
|
436
|
+
end
|
437
|
+
assert_equal(Fluent::Plugin::SyslogParser::REGEXP_RFC5424_WITH_PRI,
|
438
|
+
@parser.instance.patterns['format'])
|
390
439
|
end
|
391
440
|
end
|
392
441
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluentd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|
@@ -296,16 +296,22 @@ dependencies:
|
|
296
296
|
name: oj
|
297
297
|
requirement: !ruby/object:Gem::Requirement
|
298
298
|
requirements:
|
299
|
-
- - "
|
299
|
+
- - ">="
|
300
300
|
- !ruby/object:Gem::Version
|
301
301
|
version: '2.14'
|
302
|
+
- - "<"
|
303
|
+
- !ruby/object:Gem::Version
|
304
|
+
version: '4'
|
302
305
|
type: :development
|
303
306
|
prerelease: false
|
304
307
|
version_requirements: !ruby/object:Gem::Requirement
|
305
308
|
requirements:
|
306
|
-
- - "
|
309
|
+
- - ">="
|
307
310
|
- !ruby/object:Gem::Version
|
308
311
|
version: '2.14'
|
312
|
+
- - "<"
|
313
|
+
- !ruby/object:Gem::Version
|
314
|
+
version: '4'
|
309
315
|
description: Fluentd is an open source data collector designed to scale and simplify
|
310
316
|
log management. It can collect, process and ship many kinds of data in near real-time.
|
311
317
|
email:
|