fluentd 1.18.0 → 1.19.0

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.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +116 -0
  3. data/CHANGELOG.md +235 -12
  4. data/MAINTAINERS.md +8 -2
  5. data/README.md +3 -7
  6. data/Rakefile +2 -0
  7. data/SECURITY.md +5 -3
  8. data/lib/fluent/command/cap_ctl.rb +2 -2
  9. data/lib/fluent/command/fluentd.rb +6 -2
  10. data/lib/fluent/compat/formatter.rb +6 -0
  11. data/lib/fluent/compat/socket_util.rb +2 -2
  12. data/lib/fluent/config/configure_proxy.rb +1 -1
  13. data/lib/fluent/config/element.rb +2 -2
  14. data/lib/fluent/config/literal_parser.rb +3 -3
  15. data/lib/fluent/config/parser.rb +15 -3
  16. data/lib/fluent/config/section.rb +2 -2
  17. data/lib/fluent/config/types.rb +1 -1
  18. data/lib/fluent/config/v1_parser.rb +3 -3
  19. data/lib/fluent/counter/store.rb +1 -1
  20. data/lib/fluent/engine.rb +1 -1
  21. data/lib/fluent/env.rb +3 -2
  22. data/lib/fluent/event.rb +7 -6
  23. data/lib/fluent/log/console_adapter.rb +5 -7
  24. data/lib/fluent/log.rb +23 -0
  25. data/lib/fluent/plugin/bare_output.rb +0 -16
  26. data/lib/fluent/plugin/base.rb +2 -2
  27. data/lib/fluent/plugin/buf_file.rb +15 -1
  28. data/lib/fluent/plugin/buf_file_single.rb +15 -1
  29. data/lib/fluent/plugin/buffer/chunk.rb +74 -10
  30. data/lib/fluent/plugin/buffer/file_chunk.rb +9 -5
  31. data/lib/fluent/plugin/buffer/file_single_chunk.rb +3 -3
  32. data/lib/fluent/plugin/buffer/memory_chunk.rb +2 -2
  33. data/lib/fluent/plugin/buffer.rb +34 -6
  34. data/lib/fluent/plugin/compressable.rb +68 -22
  35. data/lib/fluent/plugin/filter.rb +0 -8
  36. data/lib/fluent/plugin/filter_record_transformer.rb +1 -1
  37. data/lib/fluent/plugin/formatter_csv.rb +18 -4
  38. data/lib/fluent/plugin/formatter_json.rb +7 -4
  39. data/lib/fluent/plugin/formatter_out_file.rb +5 -2
  40. data/lib/fluent/plugin/in_forward.rb +9 -5
  41. data/lib/fluent/plugin/in_http.rb +9 -4
  42. data/lib/fluent/plugin/in_monitor_agent.rb +4 -8
  43. data/lib/fluent/plugin/in_tail/position_file.rb +1 -1
  44. data/lib/fluent/plugin/in_tail.rb +80 -57
  45. data/lib/fluent/plugin/in_tcp.rb +2 -2
  46. data/lib/fluent/plugin/in_udp.rb +1 -1
  47. data/lib/fluent/plugin/input.rb +0 -8
  48. data/lib/fluent/plugin/multi_output.rb +1 -17
  49. data/lib/fluent/plugin/out_exec_filter.rb +2 -2
  50. data/lib/fluent/plugin/out_file.rb +37 -30
  51. data/lib/fluent/plugin/out_forward/connection_manager.rb +2 -2
  52. data/lib/fluent/plugin/out_forward.rb +23 -13
  53. data/lib/fluent/plugin/out_http.rb +1 -1
  54. data/lib/fluent/plugin/out_secondary_file.rb +2 -2
  55. data/lib/fluent/plugin/out_stdout.rb +10 -3
  56. data/lib/fluent/plugin/out_stream.rb +3 -3
  57. data/lib/fluent/plugin/output.rb +24 -35
  58. data/lib/fluent/plugin/owned_by_mixin.rb +2 -2
  59. data/lib/fluent/plugin/parser.rb +3 -3
  60. data/lib/fluent/plugin/parser_json.rb +3 -3
  61. data/lib/fluent/plugin/sd_file.rb +2 -2
  62. data/lib/fluent/plugin/storage_local.rb +8 -4
  63. data/lib/fluent/plugin.rb +1 -1
  64. data/lib/fluent/plugin_helper/child_process.rb +2 -2
  65. data/lib/fluent/plugin_helper/http_server/request.rb +13 -2
  66. data/lib/fluent/plugin_helper/http_server/server.rb +4 -14
  67. data/lib/fluent/plugin_helper/http_server.rb +1 -8
  68. data/lib/fluent/plugin_helper/metrics.rb +7 -0
  69. data/lib/fluent/plugin_helper/server.rb +4 -1
  70. data/lib/fluent/plugin_helper/service_discovery.rb +1 -1
  71. data/lib/fluent/plugin_helper/socket_option.rb +2 -2
  72. data/lib/fluent/plugin_helper/storage.rb +1 -1
  73. data/lib/fluent/plugin_id.rb +3 -3
  74. data/lib/fluent/root_agent.rb +4 -3
  75. data/lib/fluent/static_config_analysis.rb +3 -2
  76. data/lib/fluent/supervisor.rb +51 -5
  77. data/lib/fluent/system_config.rb +13 -4
  78. data/lib/fluent/test/base.rb +1 -1
  79. data/lib/fluent/test/driver/base.rb +2 -2
  80. data/lib/fluent/test/filter_test.rb +2 -2
  81. data/lib/fluent/test/formatter_test.rb +1 -1
  82. data/lib/fluent/test/helpers.rb +4 -0
  83. data/lib/fluent/test/input_test.rb +2 -2
  84. data/lib/fluent/test/output_test.rb +4 -4
  85. data/lib/fluent/test/parser_test.rb +1 -1
  86. data/lib/fluent/tls.rb +24 -0
  87. data/lib/fluent/variable_store.rb +1 -1
  88. data/lib/fluent/version.rb +1 -1
  89. data/lib/fluent/winsvc.rb +38 -8
  90. metadata +85 -16
  91. data/lib/fluent/plugin_helper/http_server/compat/server.rb +0 -92
  92. data/lib/fluent/plugin_helper/http_server/compat/ssl_context_extractor.rb +0 -52
  93. 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.18.0
4
+ version: 1.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-29 00:00:00.000000000 Z
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,76 @@ 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
+ type: :runtime
224
+ prerelease: false
225
+ version_requirements: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: '1.0'
230
+ - !ruby/object:Gem::Dependency
231
+ name: async-http
232
+ requirement: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: '0.86'
237
+ type: :runtime
238
+ prerelease: false
239
+ version_requirements: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - "~>"
242
+ - !ruby/object:Gem::Version
243
+ version: '0.86'
244
+ - !ruby/object:Gem::Dependency
245
+ name: io-event
246
+ requirement: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - "<"
249
+ - !ruby/object:Gem::Version
250
+ version: 1.11.0
251
+ type: :runtime
252
+ prerelease: false
253
+ version_requirements: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - "<"
256
+ - !ruby/object:Gem::Version
257
+ version: 1.11.0
258
+ - !ruby/object:Gem::Dependency
259
+ name: io-stream
260
+ requirement: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - "<"
263
+ - !ruby/object:Gem::Version
264
+ version: 0.8.0
265
+ type: :runtime
266
+ prerelease: false
267
+ version_requirements: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - "<"
270
+ - !ruby/object:Gem::Version
271
+ version: 0.8.0
203
272
  - !ruby/object:Gem::Dependency
204
273
  name: base64
205
274
  requirement: !ruby/object:Gem::Requirement
@@ -389,19 +458,19 @@ dependencies:
389
458
  - !ruby/object:Gem::Version
390
459
  version: '4'
391
460
  - !ruby/object:Gem::Dependency
392
- name: async-http
461
+ name: console
393
462
  requirement: !ruby/object:Gem::Requirement
394
463
  requirements:
395
- - - ">="
464
+ - - "~>"
396
465
  - !ruby/object:Gem::Version
397
- version: 0.50.0
466
+ version: '1.30'
398
467
  type: :development
399
468
  prerelease: false
400
469
  version_requirements: !ruby/object:Gem::Requirement
401
470
  requirements:
402
- - - ">="
471
+ - - "~>"
403
472
  - !ruby/object:Gem::Version
404
- version: 0.50.0
473
+ version: '1.30'
405
474
  - !ruby/object:Gem::Dependency
406
475
  name: aws-sigv4
407
476
  requirement: !ruby/object:Gem::Requirement
@@ -463,6 +532,7 @@ extensions: []
463
532
  extra_rdoc_files: []
464
533
  files:
465
534
  - ".deepsource.toml"
535
+ - ".rubocop.yml"
466
536
  - ADOPTERS.md
467
537
  - AUTHORS
468
538
  - CHANGELOG.md
@@ -712,9 +782,6 @@ files:
712
782
  - lib/fluent/plugin_helper/formatter.rb
713
783
  - lib/fluent/plugin_helper/http_server.rb
714
784
  - 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
785
  - lib/fluent/plugin_helper/http_server/methods.rb
719
786
  - lib/fluent/plugin_helper/http_server/request.rb
720
787
  - lib/fluent/plugin_helper/http_server/router.rb
@@ -797,8 +864,11 @@ files:
797
864
  homepage: https://www.fluentd.org/
798
865
  licenses:
799
866
  - Apache-2.0
800
- metadata: {}
801
- post_install_message:
867
+ metadata:
868
+ homepage_uri: https://www.fluentd.org/
869
+ source_code_uri: https://github.com/fluent/fluentd
870
+ changelog_uri: https://github.com/fluent/fluentd/blob/master/CHANGELOG.md
871
+ bug_tracker_uri: https://github.com/fluent/fluentd/issues
802
872
  rdoc_options: []
803
873
  require_paths:
804
874
  - lib
@@ -806,15 +876,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
806
876
  requirements:
807
877
  - - ">="
808
878
  - !ruby/object:Gem::Version
809
- version: '2.7'
879
+ version: '3.2'
810
880
  required_rubygems_version: !ruby/object:Gem::Requirement
811
881
  requirements:
812
882
  - - ">="
813
883
  - !ruby/object:Gem::Version
814
884
  version: '0'
815
885
  requirements: []
816
- rubygems_version: 3.4.19
817
- signing_key:
886
+ rubygems_version: 3.6.8
818
887
  specification_version: 4
819
888
  summary: Fluentd event collector
820
889
  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