fluentd 1.0.0.rc1 → 1.0.0
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/CHANGELOG.md +29 -1
- data/lib/fluent/plugin/filter_parser.rb +7 -0
- data/lib/fluent/plugin/multi_output.rb +1 -0
- data/lib/fluent/plugin/out_copy.rb +25 -2
- data/lib/fluent/plugin/parser_json.rb +1 -0
- data/lib/fluent/plugin/parser_multiline.rb +1 -0
- data/lib/fluent/plugin/parser_none.rb +1 -0
- data/lib/fluent/plugin/parser_regexp.rb +3 -0
- data/lib/fluent/plugin/parser_syslog.rb +3 -0
- data/lib/fluent/plugin_helper/server.rb +29 -11
- data/lib/fluent/version.rb +1 -1
- data/test/plugin/test_out_copy.rb +31 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88ca4ec7c1507eb95cad4a86d039a850bfe12424
|
4
|
+
data.tar.gz: b45cd0bea4a3e2091026ab0c0de8da58b2dc7de8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96e8b778f0ce8f7c3c7057a703842499a8b3d492298b54a858b91f8910f68a41618310a1f71f81c7c8628a8c74934a566c55ef31e866aee1c793e02f669a9ddf
|
7
|
+
data.tar.gz: 71131b5600b865b21170ef5a347b74c61ea872146ebfd34985466629c8379ecf6255d5abfc8ebf95a437a862ba285e1b4b8ca6d407fefe3c4703d88f688627f0
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
# v1.0
|
2
2
|
|
3
|
-
## Release v1.0.0
|
3
|
+
## Release v1.0.0 - 2017/12/6
|
4
4
|
|
5
5
|
### New features / Enhancements
|
6
6
|
|
7
|
+
* out_copy: Support ignore_error argument in `<store>`
|
8
|
+
https://github.com/fluent/fluentd/pull/1764
|
9
|
+
* server helper: Improve resource usage of TLS transport
|
10
|
+
https://github.com/fluent/fluentd/pull/1764
|
7
11
|
* Disable tracepoint feature to omit unnecessary insts
|
8
12
|
https://github.com/fluent/fluentd/pull/1764
|
9
13
|
|
@@ -13,9 +17,33 @@
|
|
13
17
|
https://github.com/fluent/fluentd/pull/1686
|
14
18
|
* plugin: Combine before_shutdown and shutdown call in one sequence.
|
15
19
|
https://github.com/fluent/fluentd/pull/1763
|
20
|
+
* Add description to parsers
|
21
|
+
https://github.com/fluent/fluentd/pull/1776
|
22
|
+
https://github.com/fluent/fluentd/pull/1777
|
23
|
+
https://github.com/fluent/fluentd/pull/1778
|
24
|
+
https://github.com/fluent/fluentd/pull/1779
|
25
|
+
https://github.com/fluent/fluentd/pull/1780
|
26
|
+
* filter_parser: Add parameter description
|
27
|
+
https://github.com/fluent/fluentd/pull/1773
|
28
|
+
* plugin: Combine before_shutdown and shutdown call in one sequence.
|
29
|
+
https://github.com/fluent/fluentd/pull/1763
|
16
30
|
|
17
31
|
# v0.14
|
18
32
|
|
33
|
+
## Release v0.14.25 - 2017/11/29
|
34
|
+
|
35
|
+
### New features / Enhancements
|
36
|
+
|
37
|
+
* Disable tracepoint feature to omit unnecessary insts
|
38
|
+
https://github.com/fluent/fluentd/pull/1764
|
39
|
+
|
40
|
+
### Bug fixes
|
41
|
+
|
42
|
+
* out_forward: Don't update retry state when failed to get ack response.
|
43
|
+
https://github.com/fluent/fluentd/pull/1686
|
44
|
+
* plugin: Combine before_shutdown and shutdown call in one sequence.
|
45
|
+
https://github.com/fluent/fluentd/pull/1763
|
46
|
+
|
19
47
|
## Release v0.14.24 - 2017/11/24
|
20
48
|
|
21
49
|
### New features / Enhancements
|
@@ -26,12 +26,19 @@ module Fluent::Plugin
|
|
26
26
|
|
27
27
|
helpers :parser, :record_accessor, :compat_parameters
|
28
28
|
|
29
|
+
desc 'Specify field name in the record to parse.'
|
29
30
|
config_param :key_name, :string
|
31
|
+
desc 'Keep original key-value pair in parsed result.'
|
30
32
|
config_param :reserve_data, :bool, default: false
|
33
|
+
desc 'Keep original event time in parsed result.'
|
31
34
|
config_param :reserve_time, :bool, default: false
|
35
|
+
desc 'Store parsed values with specified key name prefix.'
|
32
36
|
config_param :inject_key_prefix, :string, default: nil
|
37
|
+
desc 'If true, invalid string is replaced with safe characters and re-parse it.'
|
33
38
|
config_param :replace_invalid_sequence, :bool, default: false
|
39
|
+
desc 'Store parsed values as a hash value in a field.'
|
34
40
|
config_param :hash_value_field, :string, default: nil
|
41
|
+
desc 'Emit invalid record to @ERROR label'
|
35
42
|
config_param :emit_invalid_record_to_error, :bool, default: true
|
36
43
|
|
37
44
|
attr_reader :parser
|
@@ -29,6 +29,7 @@ module Fluent
|
|
29
29
|
helpers :event_emitter # to get router from agent, which will be supplied to child plugins
|
30
30
|
|
31
31
|
config_section :store, param_name: :stores, multi: true, required: true do
|
32
|
+
config_argument :arg, :string, default: ''
|
32
33
|
config_param :@type, :string, default: nil
|
33
34
|
end
|
34
35
|
|
@@ -25,6 +25,21 @@ module Fluent::Plugin
|
|
25
25
|
desc 'If true, pass different record to each `store` plugin.'
|
26
26
|
config_param :deep_copy, :bool, default: false
|
27
27
|
|
28
|
+
attr_reader :ignore_errors
|
29
|
+
|
30
|
+
def initialize
|
31
|
+
super
|
32
|
+
@ignore_errors = []
|
33
|
+
end
|
34
|
+
|
35
|
+
def configure(conf)
|
36
|
+
super
|
37
|
+
|
38
|
+
@stores.each { |store|
|
39
|
+
@ignore_errors << (store.arg == 'ignore_error')
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
28
43
|
def multi_workers_ready?
|
29
44
|
true
|
30
45
|
end
|
@@ -38,8 +53,16 @@ module Fluent::Plugin
|
|
38
53
|
es = m
|
39
54
|
end
|
40
55
|
|
41
|
-
outputs.
|
42
|
-
|
56
|
+
outputs.each_with_index do |output, i|
|
57
|
+
begin
|
58
|
+
output.emit_events(tag, @deep_copy ? es.dup : es)
|
59
|
+
rescue => e
|
60
|
+
if @ignore_errors[i]
|
61
|
+
log.error "ignore emit error", error: e
|
62
|
+
else
|
63
|
+
raise e
|
64
|
+
end
|
65
|
+
end
|
43
66
|
end
|
44
67
|
end
|
45
68
|
end
|
@@ -21,8 +21,11 @@ module Fluent
|
|
21
21
|
class RegexpParser < Parser
|
22
22
|
Plugin.register_parser("regexp", self)
|
23
23
|
|
24
|
+
desc 'Regular expression for matching logs'
|
24
25
|
config_param :expression, :string
|
26
|
+
desc 'Ignore case in matching'
|
25
27
|
config_param :ignorecase, :bool, default: false
|
28
|
+
desc 'Build regular expression as a multline mode'
|
26
29
|
config_param :multiline, :bool, default: false
|
27
30
|
|
28
31
|
config_set_default :time_key, 'time'
|
@@ -32,8 +32,11 @@ module Fluent
|
|
32
32
|
REGEXP_DETECT_RFC5424 = /^\<.*\>[1-9]\d{0,2}/
|
33
33
|
|
34
34
|
config_set_default :time_format, "%b %d %H:%M:%S"
|
35
|
+
desc 'If the incoming logs have priority prefix, e.g. <9>, set true'
|
35
36
|
config_param :with_priority, :bool, default: false
|
37
|
+
desc 'Specify protocol format'
|
36
38
|
config_param :message_format, :enum, list: [:rfc3164, :rfc5424, :auto], default: :rfc3164
|
39
|
+
desc 'Specify time format for event time for rfc5424 protocol'
|
37
40
|
config_param :rfc5424_time_format, :string, default: "%Y-%m-%dT%H:%M:%S.%L%z"
|
38
41
|
|
39
42
|
def initialize
|
@@ -661,22 +661,39 @@ module Fluent
|
|
661
661
|
end
|
662
662
|
end
|
663
663
|
|
664
|
+
if RUBY_VERSION.to_f >= 2.3
|
665
|
+
NONBLOCK_ARG = {exception: false}
|
666
|
+
def try_handshake
|
667
|
+
@_handler_socket.accept_nonblock(NONBLOCK_ARG)
|
668
|
+
end
|
669
|
+
else
|
670
|
+
def try_handshake
|
671
|
+
@_handler_socket.accept_nonblock
|
672
|
+
rescue IO::WaitReadable
|
673
|
+
:wait_readable
|
674
|
+
rescue IO::WaitWritable
|
675
|
+
:wait_writable
|
676
|
+
end
|
677
|
+
end
|
678
|
+
|
664
679
|
def try_tls_accept
|
665
680
|
return true if @_handler_accepted
|
666
681
|
|
667
682
|
begin
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
683
|
+
result = try_handshake # this method call actually try to do handshake via TLS
|
684
|
+
if result == :wait_readable || result == :wait_writable
|
685
|
+
# retry accept_nonblock: there aren't enough data in underlying socket buffer
|
686
|
+
else
|
687
|
+
@_handler_accepted = true
|
688
|
+
|
689
|
+
@callback_connection = TLSCallbackSocket.new(self)
|
690
|
+
@connect_callback.call(@callback_connection)
|
691
|
+
unless @data_callback
|
692
|
+
raise "connection callback must call #data to set data callback"
|
693
|
+
end
|
694
|
+
|
695
|
+
return true
|
675
696
|
end
|
676
|
-
return true
|
677
|
-
|
678
|
-
rescue IO::WaitReadable, IO::WaitWritable
|
679
|
-
# retry accept_nonblock: there aren't enough data in underlying socket buffer
|
680
697
|
rescue OpenSSL::SSL::SSLError => e
|
681
698
|
@log.trace "unexpected error before accepting TLS connection", error: e
|
682
699
|
close rescue nil
|
@@ -700,6 +717,7 @@ module Fluent
|
|
700
717
|
def on_writable
|
701
718
|
begin
|
702
719
|
@mutex.synchronize do
|
720
|
+
# Consider write_nonblock with {exception: false} when IO::WaitWritable error happens frequently.
|
703
721
|
written_bytes = @_handler_socket.write_nonblock(@_handler_write_buffer)
|
704
722
|
@_handler_write_buffer.slice!(0, written_bytes)
|
705
723
|
super
|
data/lib/fluent/version.rb
CHANGED
@@ -156,5 +156,36 @@ class CopyOutputTest < Test::Unit::TestCase
|
|
156
156
|
end
|
157
157
|
end
|
158
158
|
end
|
159
|
+
|
160
|
+
IGNORE_ERROR_CONFIG = %[
|
161
|
+
<store ignore_error>
|
162
|
+
@type test
|
163
|
+
name c0
|
164
|
+
</store>
|
165
|
+
<store ignore_error>
|
166
|
+
@type test
|
167
|
+
name c1
|
168
|
+
</store>
|
169
|
+
<store>
|
170
|
+
@type test
|
171
|
+
name c2
|
172
|
+
</store>
|
173
|
+
]
|
174
|
+
|
175
|
+
def test_ignore_error
|
176
|
+
d = create_driver(IGNORE_ERROR_CONFIG)
|
177
|
+
|
178
|
+
# override to raise an error
|
179
|
+
d.instance.outputs[0].define_singleton_method(:process) do |tag, es|
|
180
|
+
raise ArgumentError, 'Failed'
|
181
|
+
end
|
182
|
+
|
183
|
+
time = Time.parse("2011-01-02 13:14:15 UTC").to_i
|
184
|
+
assert_nothing_raised do
|
185
|
+
d.run(default_tag: 'test') do
|
186
|
+
d.feed(time, {"a"=>1})
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
159
190
|
end
|
160
191
|
|
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.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|
@@ -737,9 +737,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
737
737
|
version: '2.1'
|
738
738
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
739
739
|
requirements:
|
740
|
-
- - "
|
740
|
+
- - ">="
|
741
741
|
- !ruby/object:Gem::Version
|
742
|
-
version:
|
742
|
+
version: '0'
|
743
743
|
requirements: []
|
744
744
|
rubyforge_project:
|
745
745
|
rubygems_version: 2.6.13
|