fluentd 1.18.0 → 1.19.1
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 +4 -4
- data/.rubocop.yml +116 -0
- data/CHANGELOG.md +270 -12
- data/MAINTAINERS.md +8 -2
- data/README.md +3 -7
- data/Rakefile +2 -0
- data/SECURITY.md +11 -3
- data/lib/fluent/command/cap_ctl.rb +2 -2
- data/lib/fluent/command/fluentd.rb +6 -2
- data/lib/fluent/compat/formatter.rb +6 -0
- data/lib/fluent/compat/socket_util.rb +2 -2
- data/lib/fluent/config/configure_proxy.rb +1 -1
- data/lib/fluent/config/element.rb +2 -2
- data/lib/fluent/config/literal_parser.rb +3 -3
- data/lib/fluent/config/parser.rb +15 -3
- data/lib/fluent/config/section.rb +2 -2
- data/lib/fluent/config/types.rb +1 -1
- data/lib/fluent/config/v1_parser.rb +3 -3
- data/lib/fluent/config/yaml_parser/parser.rb +10 -2
- data/lib/fluent/counter/store.rb +1 -1
- data/lib/fluent/engine.rb +1 -1
- data/lib/fluent/env.rb +3 -2
- data/lib/fluent/event.rb +7 -6
- data/lib/fluent/log/console_adapter.rb +5 -7
- data/lib/fluent/log.rb +23 -0
- data/lib/fluent/plugin/bare_output.rb +0 -16
- data/lib/fluent/plugin/base.rb +2 -2
- data/lib/fluent/plugin/buf_file.rb +15 -1
- data/lib/fluent/plugin/buf_file_single.rb +15 -1
- data/lib/fluent/plugin/buffer/chunk.rb +74 -10
- data/lib/fluent/plugin/buffer/file_chunk.rb +9 -5
- data/lib/fluent/plugin/buffer/file_single_chunk.rb +3 -3
- data/lib/fluent/plugin/buffer/memory_chunk.rb +2 -2
- data/lib/fluent/plugin/buffer.rb +34 -6
- data/lib/fluent/plugin/compressable.rb +68 -22
- data/lib/fluent/plugin/filter.rb +0 -8
- data/lib/fluent/plugin/filter_record_transformer.rb +1 -1
- data/lib/fluent/plugin/formatter_csv.rb +18 -4
- data/lib/fluent/plugin/formatter_json.rb +7 -4
- data/lib/fluent/plugin/formatter_out_file.rb +5 -2
- data/lib/fluent/plugin/in_forward.rb +9 -5
- data/lib/fluent/plugin/in_http.rb +9 -4
- data/lib/fluent/plugin/in_monitor_agent.rb +4 -8
- data/lib/fluent/plugin/in_tail/position_file.rb +1 -1
- data/lib/fluent/plugin/in_tail.rb +80 -57
- data/lib/fluent/plugin/in_tcp.rb +2 -2
- data/lib/fluent/plugin/in_udp.rb +1 -1
- data/lib/fluent/plugin/input.rb +0 -8
- data/lib/fluent/plugin/multi_output.rb +1 -17
- data/lib/fluent/plugin/out_exec_filter.rb +2 -2
- data/lib/fluent/plugin/out_file.rb +37 -30
- data/lib/fluent/plugin/out_forward/connection_manager.rb +2 -2
- data/lib/fluent/plugin/out_forward.rb +23 -13
- data/lib/fluent/plugin/out_http.rb +1 -1
- data/lib/fluent/plugin/out_secondary_file.rb +2 -2
- data/lib/fluent/plugin/out_stdout.rb +10 -3
- data/lib/fluent/plugin/out_stream.rb +3 -3
- data/lib/fluent/plugin/output.rb +24 -35
- data/lib/fluent/plugin/owned_by_mixin.rb +2 -2
- data/lib/fluent/plugin/parser.rb +3 -3
- data/lib/fluent/plugin/parser_json.rb +3 -3
- data/lib/fluent/plugin/sd_file.rb +2 -2
- data/lib/fluent/plugin/storage_local.rb +8 -4
- data/lib/fluent/plugin.rb +1 -1
- data/lib/fluent/plugin_helper/child_process.rb +2 -2
- data/lib/fluent/plugin_helper/http_server/request.rb +13 -2
- data/lib/fluent/plugin_helper/http_server/server.rb +4 -14
- data/lib/fluent/plugin_helper/http_server.rb +1 -8
- data/lib/fluent/plugin_helper/metrics.rb +7 -0
- data/lib/fluent/plugin_helper/server.rb +4 -1
- data/lib/fluent/plugin_helper/service_discovery.rb +1 -1
- data/lib/fluent/plugin_helper/socket_option.rb +2 -2
- data/lib/fluent/plugin_helper/storage.rb +1 -1
- data/lib/fluent/plugin_id.rb +3 -3
- data/lib/fluent/root_agent.rb +4 -3
- data/lib/fluent/static_config_analysis.rb +3 -2
- data/lib/fluent/supervisor.rb +51 -5
- data/lib/fluent/system_config.rb +13 -4
- data/lib/fluent/test/base.rb +1 -1
- data/lib/fluent/test/driver/base.rb +2 -2
- data/lib/fluent/test/filter_test.rb +2 -2
- data/lib/fluent/test/formatter_test.rb +1 -1
- data/lib/fluent/test/helpers.rb +4 -0
- data/lib/fluent/test/input_test.rb +2 -2
- data/lib/fluent/test/output_test.rb +4 -4
- data/lib/fluent/test/parser_test.rb +1 -1
- data/lib/fluent/test.rb +5 -2
- data/lib/fluent/tls.rb +24 -0
- data/lib/fluent/variable_store.rb +1 -1
- data/lib/fluent/version.rb +1 -1
- data/lib/fluent/winsvc.rb +38 -8
- metadata +63 -16
- data/lib/fluent/plugin_helper/http_server/compat/server.rb +0 -92
- data/lib/fluent/plugin_helper/http_server/compat/ssl_context_extractor.rb +0 -52
- data/lib/fluent/plugin_helper/http_server/compat/webrick_handler.rb +0 -58
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fluentd
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.19.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sadayuki Furuhashi
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: bundler
|
|
@@ -200,6 +199,54 @@ dependencies:
|
|
|
200
199
|
- - "~>"
|
|
201
200
|
- !ruby/object:Gem::Version
|
|
202
201
|
version: '1.4'
|
|
202
|
+
- !ruby/object:Gem::Dependency
|
|
203
|
+
name: zstd-ruby
|
|
204
|
+
requirement: !ruby/object:Gem::Requirement
|
|
205
|
+
requirements:
|
|
206
|
+
- - "~>"
|
|
207
|
+
- !ruby/object:Gem::Version
|
|
208
|
+
version: '1.5'
|
|
209
|
+
type: :runtime
|
|
210
|
+
prerelease: false
|
|
211
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
212
|
+
requirements:
|
|
213
|
+
- - "~>"
|
|
214
|
+
- !ruby/object:Gem::Version
|
|
215
|
+
version: '1.5'
|
|
216
|
+
- !ruby/object:Gem::Dependency
|
|
217
|
+
name: uri
|
|
218
|
+
requirement: !ruby/object:Gem::Requirement
|
|
219
|
+
requirements:
|
|
220
|
+
- - "~>"
|
|
221
|
+
- !ruby/object:Gem::Version
|
|
222
|
+
version: '1.0'
|
|
223
|
+
- - "<"
|
|
224
|
+
- !ruby/object:Gem::Version
|
|
225
|
+
version: 1.1.0
|
|
226
|
+
type: :runtime
|
|
227
|
+
prerelease: false
|
|
228
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
229
|
+
requirements:
|
|
230
|
+
- - "~>"
|
|
231
|
+
- !ruby/object:Gem::Version
|
|
232
|
+
version: '1.0'
|
|
233
|
+
- - "<"
|
|
234
|
+
- !ruby/object:Gem::Version
|
|
235
|
+
version: 1.1.0
|
|
236
|
+
- !ruby/object:Gem::Dependency
|
|
237
|
+
name: async-http
|
|
238
|
+
requirement: !ruby/object:Gem::Requirement
|
|
239
|
+
requirements:
|
|
240
|
+
- - "~>"
|
|
241
|
+
- !ruby/object:Gem::Version
|
|
242
|
+
version: '0.86'
|
|
243
|
+
type: :runtime
|
|
244
|
+
prerelease: false
|
|
245
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
246
|
+
requirements:
|
|
247
|
+
- - "~>"
|
|
248
|
+
- !ruby/object:Gem::Version
|
|
249
|
+
version: '0.86'
|
|
203
250
|
- !ruby/object:Gem::Dependency
|
|
204
251
|
name: base64
|
|
205
252
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -389,19 +436,19 @@ dependencies:
|
|
|
389
436
|
- !ruby/object:Gem::Version
|
|
390
437
|
version: '4'
|
|
391
438
|
- !ruby/object:Gem::Dependency
|
|
392
|
-
name:
|
|
439
|
+
name: console
|
|
393
440
|
requirement: !ruby/object:Gem::Requirement
|
|
394
441
|
requirements:
|
|
395
|
-
- - "
|
|
442
|
+
- - "~>"
|
|
396
443
|
- !ruby/object:Gem::Version
|
|
397
|
-
version:
|
|
444
|
+
version: '1.30'
|
|
398
445
|
type: :development
|
|
399
446
|
prerelease: false
|
|
400
447
|
version_requirements: !ruby/object:Gem::Requirement
|
|
401
448
|
requirements:
|
|
402
|
-
- - "
|
|
449
|
+
- - "~>"
|
|
403
450
|
- !ruby/object:Gem::Version
|
|
404
|
-
version:
|
|
451
|
+
version: '1.30'
|
|
405
452
|
- !ruby/object:Gem::Dependency
|
|
406
453
|
name: aws-sigv4
|
|
407
454
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -463,6 +510,7 @@ extensions: []
|
|
|
463
510
|
extra_rdoc_files: []
|
|
464
511
|
files:
|
|
465
512
|
- ".deepsource.toml"
|
|
513
|
+
- ".rubocop.yml"
|
|
466
514
|
- ADOPTERS.md
|
|
467
515
|
- AUTHORS
|
|
468
516
|
- CHANGELOG.md
|
|
@@ -712,9 +760,6 @@ files:
|
|
|
712
760
|
- lib/fluent/plugin_helper/formatter.rb
|
|
713
761
|
- lib/fluent/plugin_helper/http_server.rb
|
|
714
762
|
- lib/fluent/plugin_helper/http_server/app.rb
|
|
715
|
-
- lib/fluent/plugin_helper/http_server/compat/server.rb
|
|
716
|
-
- lib/fluent/plugin_helper/http_server/compat/ssl_context_extractor.rb
|
|
717
|
-
- lib/fluent/plugin_helper/http_server/compat/webrick_handler.rb
|
|
718
763
|
- lib/fluent/plugin_helper/http_server/methods.rb
|
|
719
764
|
- lib/fluent/plugin_helper/http_server/request.rb
|
|
720
765
|
- lib/fluent/plugin_helper/http_server/router.rb
|
|
@@ -797,8 +842,11 @@ files:
|
|
|
797
842
|
homepage: https://www.fluentd.org/
|
|
798
843
|
licenses:
|
|
799
844
|
- Apache-2.0
|
|
800
|
-
metadata:
|
|
801
|
-
|
|
845
|
+
metadata:
|
|
846
|
+
homepage_uri: https://www.fluentd.org/
|
|
847
|
+
source_code_uri: https://github.com/fluent/fluentd
|
|
848
|
+
changelog_uri: https://github.com/fluent/fluentd/blob/master/CHANGELOG.md
|
|
849
|
+
bug_tracker_uri: https://github.com/fluent/fluentd/issues
|
|
802
850
|
rdoc_options: []
|
|
803
851
|
require_paths:
|
|
804
852
|
- lib
|
|
@@ -806,15 +854,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
806
854
|
requirements:
|
|
807
855
|
- - ">="
|
|
808
856
|
- !ruby/object:Gem::Version
|
|
809
|
-
version: '2
|
|
857
|
+
version: '3.2'
|
|
810
858
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
811
859
|
requirements:
|
|
812
860
|
- - ">="
|
|
813
861
|
- !ruby/object:Gem::Version
|
|
814
862
|
version: '0'
|
|
815
863
|
requirements: []
|
|
816
|
-
rubygems_version: 3.
|
|
817
|
-
signing_key:
|
|
864
|
+
rubygems_version: 3.6.8
|
|
818
865
|
specification_version: 4
|
|
819
866
|
summary: Fluentd event collector
|
|
820
867
|
test_files: []
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
# Fluentd
|
|
3
|
-
#
|
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
# you may not use this file except in compliance with the License.
|
|
6
|
-
# You may obtain a copy of the License at
|
|
7
|
-
#
|
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
#
|
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
# See the License for the specific language governing permissions and
|
|
14
|
-
# limitations under the License.
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
require 'fluent/plugin_helper/http_server/methods'
|
|
18
|
-
require 'fluent/plugin_helper/http_server/compat/webrick_handler'
|
|
19
|
-
require 'fluent/plugin_helper/http_server/compat/ssl_context_extractor'
|
|
20
|
-
|
|
21
|
-
module Fluent
|
|
22
|
-
module PluginHelper
|
|
23
|
-
module HttpServer
|
|
24
|
-
module Compat
|
|
25
|
-
class Server
|
|
26
|
-
# @param logger [Logger]
|
|
27
|
-
# @param default_app [Object] ignored option. only for compat
|
|
28
|
-
# @param tls_context [OpenSSL::SSL::SSLContext]
|
|
29
|
-
def initialize(addr:, port:, logger:, default_app: nil, tls_context: nil)
|
|
30
|
-
@addr = addr
|
|
31
|
-
@port = port
|
|
32
|
-
@logger = logger
|
|
33
|
-
|
|
34
|
-
config = {
|
|
35
|
-
BindAddress: @addr,
|
|
36
|
-
Port: @port,
|
|
37
|
-
Logger: WEBrick::Log.new(STDERR, WEBrick::Log::FATAL),
|
|
38
|
-
AccessLog: [],
|
|
39
|
-
}
|
|
40
|
-
if tls_context
|
|
41
|
-
require 'webrick/https'
|
|
42
|
-
@logger.warn('Webrick ignores given TLS version')
|
|
43
|
-
tls_opt = Fluent::PluginHelper::HttpServer::Compat::SSLContextExtractor.extract(tls_context)
|
|
44
|
-
config = tls_opt.merge(**config)
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
@server = WEBrick::HTTPServer.new(config)
|
|
48
|
-
|
|
49
|
-
# @example ["/example.json", :get, handler object]
|
|
50
|
-
@methods = []
|
|
51
|
-
|
|
52
|
-
if block_given?
|
|
53
|
-
yield(self)
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def start(notify = nil)
|
|
58
|
-
build_handler
|
|
59
|
-
notify.push(:ready)
|
|
60
|
-
@logger.debug('Start webrick HTTP server listening')
|
|
61
|
-
@server.start
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
def stop
|
|
65
|
-
@server.shutdown
|
|
66
|
-
@server.stop
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
HttpServer::Methods::ALL.map { |e| e.downcase.to_sym }.each do |name|
|
|
70
|
-
define_method(name) do |path, app = nil, &block|
|
|
71
|
-
if (block && app) || (!block && !app)
|
|
72
|
-
raise 'You must specify either app or block in the same time'
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
# Do not build a handler class here to able to handle multiple methods for single path.
|
|
76
|
-
@methods << [path, name, app || block]
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
private
|
|
81
|
-
|
|
82
|
-
def build_handler
|
|
83
|
-
@methods.group_by(&:first).each do |(path, rest)|
|
|
84
|
-
klass = Fluent::PluginHelper::HttpServer::Compat::WebrickHandler.build(**Hash[rest.map { |e| [e[1], e[2]] }])
|
|
85
|
-
@server.mount(path, klass)
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
end
|
|
89
|
-
end
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
end
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
# Fluentd
|
|
3
|
-
#
|
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
# you may not use this file except in compliance with the License.
|
|
6
|
-
# You may obtain a copy of the License at
|
|
7
|
-
#
|
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
#
|
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
# See the License for the specific language governing permissions and
|
|
14
|
-
# limitations under the License.
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
module Fluent
|
|
18
|
-
module PluginHelper
|
|
19
|
-
module HttpServer
|
|
20
|
-
module Compat
|
|
21
|
-
# This class converts OpenSSL::SSL::SSLContext to Webrick SSL Config because webrick does not have interface to pass OpenSSL::SSL::SSLContext directory
|
|
22
|
-
# https://github.com/ruby/webrick/blob/v1.6.0/lib/webrick/ssl.rb#L67-L88
|
|
23
|
-
class SSLContextExtractor
|
|
24
|
-
|
|
25
|
-
#
|
|
26
|
-
# memo: https://github.com/ruby/webrick/blob/v1.6.0/lib/webrick/ssl.rb#L180-L205
|
|
27
|
-
# @param ctx [OpenSSL::SSL::SSLContext]
|
|
28
|
-
def self.extract(ctx)
|
|
29
|
-
{
|
|
30
|
-
SSLEnable: true,
|
|
31
|
-
SSLPrivateKey: ctx.key,
|
|
32
|
-
SSLCertificate: ctx.cert,
|
|
33
|
-
SSLClientCA: ctx.client_ca,
|
|
34
|
-
SSLExtraChainCert: ctx.extra_chain_cert,
|
|
35
|
-
SSLCACertificateFile: ctx.ca_file,
|
|
36
|
-
SSLCACertificatePath: ctx.ca_path,
|
|
37
|
-
SSLCertificateStore: ctx.cert_store,
|
|
38
|
-
SSLTmpDhCallback: ctx.tmp_dh_callback,
|
|
39
|
-
SSLVerifyClient: ctx.verify_mode,
|
|
40
|
-
SSLVerifyDepth: ctx.verify_depth,
|
|
41
|
-
SSLVerifyCallback: ctx.verify_callback,
|
|
42
|
-
SSLServerNameCallback: ctx.servername_cb,
|
|
43
|
-
SSLTimeout: ctx.timeout,
|
|
44
|
-
SSLOptions: ctx.options,
|
|
45
|
-
SSLCiphers: ctx.ciphers,
|
|
46
|
-
}
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
end
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
# Fluentd
|
|
3
|
-
#
|
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
# you may not use this file except in compliance with the License.
|
|
6
|
-
# You may obtain a copy of the License at
|
|
7
|
-
#
|
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
#
|
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
# See the License for the specific language governing permissions and
|
|
14
|
-
# limitations under the License.
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
require 'webrick'
|
|
18
|
-
require 'json'
|
|
19
|
-
|
|
20
|
-
module Fluent
|
|
21
|
-
module PluginHelper
|
|
22
|
-
module HttpServer
|
|
23
|
-
module Compat
|
|
24
|
-
class WebrickHandler
|
|
25
|
-
# **opt is enough. but I wrote a signature explicitly for readability
|
|
26
|
-
def self.build(get: nil, head: nil, post: nil, put: nil, patch: nil, delete: nil, connect: nil, options: nil, trace: nil)
|
|
27
|
-
opt = { get: get, head: head, post: post, put: put, patch: patch, delete: delete, connect: connect, options: options, trace: trace }
|
|
28
|
-
|
|
29
|
-
Class.new(WEBrick::HTTPServlet::AbstractServlet) do
|
|
30
|
-
HttpServer::Methods::ALL.each do |name|
|
|
31
|
-
define_method("do_#{name}") do |request, response|
|
|
32
|
-
code, headers, body =
|
|
33
|
-
if request.path_info != ''
|
|
34
|
-
render_json(404, 'message' => 'Not found')
|
|
35
|
-
else
|
|
36
|
-
begin
|
|
37
|
-
opt[name.downcase.to_sym].call(request)
|
|
38
|
-
rescue => _
|
|
39
|
-
render_json(500, 'message' => 'Something went wrong')
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
response.status = code
|
|
44
|
-
headers.each { |k, v| response[k] = v }
|
|
45
|
-
response.body = body
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def render_json(code, obj)
|
|
50
|
-
[code, { 'Content-Type' => 'application/json' }, obj.to_json]
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
end
|