fluentd 1.17.1 → 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 (100) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +116 -0
  3. data/CHANGELOG.md +293 -16
  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 +13 -3
  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 +12 -5
  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 +50 -34
  21. data/lib/fluent/env.rb +6 -2
  22. data/lib/fluent/event.rb +7 -6
  23. data/lib/fluent/event_router.rb +2 -2
  24. data/lib/fluent/log/console_adapter.rb +5 -7
  25. data/lib/fluent/log.rb +23 -0
  26. data/lib/fluent/plugin/bare_output.rb +0 -16
  27. data/lib/fluent/plugin/base.rb +2 -2
  28. data/lib/fluent/plugin/buf_file.rb +15 -1
  29. data/lib/fluent/plugin/buf_file_single.rb +15 -1
  30. data/lib/fluent/plugin/buffer/chunk.rb +74 -10
  31. data/lib/fluent/plugin/buffer/file_chunk.rb +9 -5
  32. data/lib/fluent/plugin/buffer/file_single_chunk.rb +3 -3
  33. data/lib/fluent/plugin/buffer/memory_chunk.rb +2 -2
  34. data/lib/fluent/plugin/buffer.rb +34 -6
  35. data/lib/fluent/plugin/compressable.rb +68 -22
  36. data/lib/fluent/plugin/filter.rb +0 -8
  37. data/lib/fluent/plugin/filter_parser.rb +27 -51
  38. data/lib/fluent/plugin/filter_record_transformer.rb +1 -1
  39. data/lib/fluent/plugin/formatter_csv.rb +18 -4
  40. data/lib/fluent/plugin/formatter_json.rb +7 -4
  41. data/lib/fluent/plugin/formatter_out_file.rb +5 -2
  42. data/lib/fluent/plugin/in_forward.rb +9 -5
  43. data/lib/fluent/plugin/in_http.rb +14 -4
  44. data/lib/fluent/plugin/in_monitor_agent.rb +4 -8
  45. data/lib/fluent/plugin/in_syslog.rb +4 -0
  46. data/lib/fluent/plugin/in_tail/position_file.rb +1 -1
  47. data/lib/fluent/plugin/in_tail.rb +80 -57
  48. data/lib/fluent/plugin/in_tcp.rb +6 -2
  49. data/lib/fluent/plugin/in_udp.rb +11 -2
  50. data/lib/fluent/plugin/input.rb +4 -8
  51. data/lib/fluent/plugin/multi_output.rb +1 -17
  52. data/lib/fluent/plugin/out_buffer.rb +40 -0
  53. data/lib/fluent/plugin/out_exec_filter.rb +2 -2
  54. data/lib/fluent/plugin/out_file.rb +37 -30
  55. data/lib/fluent/plugin/out_forward/connection_manager.rb +2 -2
  56. data/lib/fluent/plugin/out_forward.rb +23 -13
  57. data/lib/fluent/plugin/out_http.rb +1 -1
  58. data/lib/fluent/plugin/out_secondary_file.rb +2 -2
  59. data/lib/fluent/plugin/out_stdout.rb +10 -3
  60. data/lib/fluent/plugin/out_stream.rb +3 -3
  61. data/lib/fluent/plugin/output.rb +26 -35
  62. data/lib/fluent/plugin/owned_by_mixin.rb +2 -2
  63. data/lib/fluent/plugin/parser.rb +3 -3
  64. data/lib/fluent/plugin/parser_json.rb +3 -3
  65. data/lib/fluent/plugin/sd_file.rb +2 -2
  66. data/lib/fluent/plugin/storage_local.rb +8 -4
  67. data/lib/fluent/plugin.rb +1 -1
  68. data/lib/fluent/plugin_helper/cert_option.rb +8 -0
  69. data/lib/fluent/plugin_helper/child_process.rb +2 -2
  70. data/lib/fluent/plugin_helper/event_emitter.rb +12 -0
  71. data/lib/fluent/plugin_helper/http_server/request.rb +13 -2
  72. data/lib/fluent/plugin_helper/http_server/server.rb +14 -8
  73. data/lib/fluent/plugin_helper/http_server.rb +1 -8
  74. data/lib/fluent/plugin_helper/metrics.rb +7 -0
  75. data/lib/fluent/plugin_helper/server.rb +13 -1
  76. data/lib/fluent/plugin_helper/service_discovery.rb +1 -1
  77. data/lib/fluent/plugin_helper/socket_option.rb +2 -2
  78. data/lib/fluent/plugin_helper/storage.rb +1 -1
  79. data/lib/fluent/plugin_id.rb +3 -3
  80. data/lib/fluent/root_agent.rb +117 -21
  81. data/lib/fluent/source_only_buffer_agent.rb +102 -0
  82. data/lib/fluent/static_config_analysis.rb +3 -2
  83. data/lib/fluent/supervisor.rb +258 -39
  84. data/lib/fluent/system_config.rb +27 -6
  85. data/lib/fluent/test/base.rb +1 -1
  86. data/lib/fluent/test/driver/base.rb +2 -2
  87. data/lib/fluent/test/filter_test.rb +2 -2
  88. data/lib/fluent/test/formatter_test.rb +1 -1
  89. data/lib/fluent/test/helpers.rb +4 -0
  90. data/lib/fluent/test/input_test.rb +2 -2
  91. data/lib/fluent/test/output_test.rb +4 -4
  92. data/lib/fluent/test/parser_test.rb +1 -1
  93. data/lib/fluent/tls.rb +24 -0
  94. data/lib/fluent/variable_store.rb +1 -1
  95. data/lib/fluent/version.rb +1 -1
  96. data/lib/fluent/winsvc.rb +38 -8
  97. metadata +85 -28
  98. data/lib/fluent/plugin_helper/http_server/compat/server.rb +0 -92
  99. data/lib/fluent/plugin_helper/http_server/compat/ssl_context_extractor.rb +0 -52
  100. data/lib/fluent/plugin_helper/http_server/compat/webrick_handler.rb +0 -58
@@ -16,6 +16,7 @@
16
16
 
17
17
  require 'fluent/configurable'
18
18
  require 'fluent/config/element'
19
+ require 'fluent/env'
19
20
 
20
21
  module Fluent
21
22
  class SystemConfig
@@ -25,10 +26,11 @@ module Fluent
25
26
  :workers, :restart_worker_interval, :root_dir, :log_level,
26
27
  :suppress_repeated_stacktrace, :emit_error_log_interval, :suppress_config_dump,
27
28
  :log_event_verbose, :ignore_repeated_log_interval, :ignore_same_log_interval,
28
- :without_source, :rpc_endpoint, :enable_get_dump, :process_name,
29
+ :without_source, :with_source_only, :rpc_endpoint, :enable_get_dump, :process_name,
29
30
  :file_permission, :dir_permission, :counter_server, :counter_client,
30
31
  :strict_config_value, :enable_msgpack_time_support, :disable_shared_socket,
31
- :metrics, :enable_input_metrics, :enable_size_metrics, :enable_jit
32
+ :metrics, :enable_input_metrics, :enable_size_metrics, :enable_jit, :source_only_buffer,
33
+ :config_include_dir
32
34
  ]
33
35
 
34
36
  config_param :workers, :integer, default: 1
@@ -41,14 +43,15 @@ module Fluent
41
43
  config_param :emit_error_log_interval, :time, default: nil
42
44
  config_param :suppress_config_dump, :bool, default: nil
43
45
  config_param :log_event_verbose, :bool, default: nil
44
- config_param :without_source, :bool, default: nil
46
+ config_param :without_source, :bool, default: nil
47
+ config_param :with_source_only, :bool, default: nil
45
48
  config_param :rpc_endpoint, :string, default: nil
46
49
  config_param :enable_get_dump, :bool, default: nil
47
50
  config_param :process_name, :string, default: nil
48
51
  config_param :strict_config_value, :bool, default: nil
49
52
  config_param :enable_msgpack_time_support, :bool, default: nil
50
53
  config_param :disable_shared_socket, :bool, default: nil
51
- config_param :enable_input_metrics, :bool, default: nil
54
+ config_param :enable_input_metrics, :bool, default: true
52
55
  config_param :enable_size_metrics, :bool, default: nil
53
56
  config_param :enable_jit, :bool, default: false
54
57
  config_param :file_permission, default: nil do |v|
@@ -57,7 +60,9 @@ module Fluent
57
60
  config_param :dir_permission, default: nil do |v|
58
61
  v.to_i(8)
59
62
  end
63
+ config_param :config_include_dir, default: Fluent::DEFAULT_CONFIG_INCLUDE_DIR
60
64
  config_section :log, required: false, init: true, multi: false do
65
+ config_param :path, :string, default: nil
61
66
  config_param :format, :enum, list: [:text, :json], default: :text
62
67
  config_param :time_format, :string, default: '%Y-%m-%d %H:%M:%S %z'
63
68
  config_param :rotate_age, default: nil do |v|
@@ -74,6 +79,7 @@ module Fluent
74
79
  end
75
80
  end
76
81
  config_param :rotate_size, :size, default: nil
82
+ config_param :forced_stacktrace_level, :enum, list: [:none, :trace, :debug, :info, :warn, :error, :fatal], default: :none
77
83
  end
78
84
 
79
85
  config_section :counter_server, multi: false do
@@ -103,6 +109,20 @@ module Fluent
103
109
  config_param :labels, :hash, default: {}
104
110
  end
105
111
 
112
+ config_section :source_only_buffer, init: true, multi: false do
113
+ config_param :flush_thread_count, :integer, default: 1
114
+ config_param :overflow_action, :enum, list: [:throw_exception, :block, :drop_oldest_chunk], default: :drop_oldest_chunk
115
+ config_param :path, :string, default: nil
116
+ config_param :flush_interval, :time, default: nil
117
+ config_param :chunk_limit_size, :size, default: nil
118
+ config_param :total_limit_size, :size, default: nil
119
+ config_param :compress, :enum, list: [:text, :gzip], default: nil
120
+ end
121
+
122
+ def force_stacktrace_level?
123
+ @log.forced_stacktrace_level != :none
124
+ end
125
+
106
126
  def self.create(conf, strict_config_value=false)
107
127
  systems = conf.elements(name: 'system')
108
128
  return SystemConfig.new if systems.empty?
@@ -147,6 +167,7 @@ module Fluent
147
167
  end
148
168
 
149
169
  @log_level = Log.str_to_level(@log_level.to_s) if @log_level
170
+ @log[:forced_stacktrace_level] = Log.str_to_level(@log.forced_stacktrace_level.to_s) if force_stacktrace_level?
150
171
  end
151
172
 
152
173
  def dup
@@ -171,13 +192,13 @@ module Fluent
171
192
  unless defined?($_system_config)
172
193
  $_system_config = nil
173
194
  end
174
- (instance_variable_defined?("@_system_config") && @_system_config) ||
195
+ (instance_variable_defined?(:@_system_config) && @_system_config) ||
175
196
  $_system_config || Fluent::Engine.system_config
176
197
  end
177
198
 
178
199
  def system_config_override(opts={})
179
200
  require 'fluent/engine'
180
- if !instance_variable_defined?("@_system_config") || @_system_config.nil?
201
+ if !instance_variable_defined?(:@_system_config) || @_system_config.nil?
181
202
  @_system_config = (defined?($_system_config) && $_system_config ? $_system_config : Fluent::Engine.system_config).dup
182
203
  end
183
204
  opts.each_pair do |key, value|
@@ -32,7 +32,7 @@ module Fluent
32
32
  # klass.dup is worse because its ancestors does NOT include original class name
33
33
  klass_name = klass.name
34
34
  klass = Class.new(klass)
35
- klass.define_singleton_method("name") { klass_name }
35
+ klass.define_singleton_method(:name) { klass_name }
36
36
  klass.module_eval(&block)
37
37
  end
38
38
  @instance = klass.new
@@ -185,7 +185,7 @@ module Fluent
185
185
  end
186
186
  end
187
187
 
188
- def run_actual(timeout: DEFAULT_TIMEOUT, &block)
188
+ def run_actual(timeout: DEFAULT_TIMEOUT)
189
189
  if @instance.respond_to?(:_threads)
190
190
  sleep 0.1 until @instance._threads.values.all?(&:alive?)
191
191
  end
@@ -201,7 +201,7 @@ module Fluent
201
201
  return_value = nil
202
202
  begin
203
203
  Timeout.timeout(timeout * 2) do |sec|
204
- return_value = block.call if block_given?
204
+ return_value = yield if block_given?
205
205
  end
206
206
  rescue Timeout::Error
207
207
  raise TestTimedOut, "Test case timed out with hard limit."
@@ -59,9 +59,9 @@ module Fluent
59
59
  alias_method :emits, :filtered_as_array # emits is for consistent with other drivers
60
60
 
61
61
  # Almost filters don't use threads so default is 0. It reduces test time.
62
- def run(num_waits = 0, &block)
62
+ def run(num_waits = 0)
63
63
  super(num_waits) {
64
- block.call if block
64
+ yield if block_given?
65
65
 
66
66
  @events.each { |tag, es|
67
67
  processed = @instance.filter_stream(tag, es)
@@ -28,7 +28,7 @@ module Fluent
28
28
  # klass.dup is worse because its ancestors does NOT include original class name
29
29
  klass_name = klass_or_str.name
30
30
  klass_or_str = Class.new(klass_or_str)
31
- klass_or_str.define_singleton_method("name") { klass_name }
31
+ klass_or_str.define_singleton_method(:name) { klass_name }
32
32
  klass_or_str.module_eval(&block)
33
33
  end
34
34
  @instance = klass_or_str.new
@@ -50,6 +50,10 @@ EOT
50
50
  end
51
51
  end
52
52
 
53
+ def event_time_without_nsec(str=nil, format: nil)
54
+ Fluent::EventTime.new(event_time(str, format: format))
55
+ end
56
+
53
57
  def with_timezone(tz)
54
58
  oldtz, ENV['TZ'] = ENV['TZ'], tz
55
59
  yield
@@ -109,7 +109,7 @@ module Fluent
109
109
  end
110
110
  end
111
111
 
112
- def run(num_waits = 10, &block)
112
+ def run(num_waits = 10)
113
113
  m = method(:emit_stream)
114
114
  unless Engine.singleton_class.ancestors.include?(EmitStreamWrapper)
115
115
  Engine.singleton_class.prepend EmitStreamWrapper
@@ -121,7 +121,7 @@ module Fluent
121
121
  instance.router.emit_stream_callee = m
122
122
 
123
123
  super(num_waits) {
124
- block.call if block
124
+ yield if block_given?
125
125
 
126
126
  if @expected_emits_length || @expects || @run_post_conditions
127
127
  # counters for emits and emit_streams
@@ -71,10 +71,10 @@ module Fluent
71
71
  (@expected_buffer ||= '') << str
72
72
  end
73
73
 
74
- def run(num_waits = 10, &block)
74
+ def run(num_waits = 10)
75
75
  result = nil
76
76
  super(num_waits) {
77
- block.call if block
77
+ yield if block_given?
78
78
 
79
79
  es = ArrayEventStream.new(@entries)
80
80
  buffer = @instance.format_stream(@tag, es)
@@ -119,10 +119,10 @@ module Fluent
119
119
  (@expected_buffer ||= '') << str
120
120
  end
121
121
 
122
- def run(&block)
122
+ def run
123
123
  result = []
124
124
  super {
125
- block.call if block
125
+ yield if block_given?
126
126
 
127
127
  buffer = ''
128
128
  lines = {}
@@ -27,7 +27,7 @@ module Fluent
27
27
  # klass.dup is worse because its ancestors does NOT include original class name
28
28
  klass_name = klass_or_str.name
29
29
  klass_or_str = Class.new(klass_or_str)
30
- klass_or_str.define_singleton_method("name") { klass_name }
30
+ klass_or_str.define_singleton_method(:name) { klass_name }
31
31
  klass_or_str.module_eval(&block)
32
32
  end
33
33
  case klass_or_str.instance_method(:initialize).arity
data/lib/fluent/tls.rb CHANGED
@@ -76,6 +76,30 @@ module Fluent
76
76
  ctx
77
77
  end
78
78
  module_function :set_version_to_context
79
+
80
+ def set_version_to_options(opt, version, min_version, max_version)
81
+ if MIN_MAX_AVAILABLE
82
+ case
83
+ when min_version.nil? && max_version.nil?
84
+ min_version = METHODS_MAP[version] || version
85
+ max_version = METHODS_MAP[version] || version
86
+ when min_version.nil? && max_version
87
+ raise Fluent::ConfigError, "When you set max_version, must set min_version together"
88
+ when min_version && max_version.nil?
89
+ raise Fluent::ConfigError, "When you set min_version, must set max_version together"
90
+ else
91
+ min_version = METHODS_MAP[min_version] || min_version
92
+ max_version = METHODS_MAP[max_version] || max_version
93
+ end
94
+ opt[:min_version] = min_version
95
+ opt[:max_version] = max_version
96
+ else
97
+ opt[:ssl_version] = METHODS_MAP[version] || version
98
+ end
99
+
100
+ opt
101
+ end
102
+ module_function :set_version_to_options
79
103
  end
80
104
  end
81
105
 
@@ -15,7 +15,7 @@
15
15
  #
16
16
 
17
17
  module Fluent
18
- # VariableStore provides all pluigns with the way to shared variable without using class variable
18
+ # VariableStore provides all plugins with the way to shared variable without using class variable
19
19
  # it's for safe reloading mechanism
20
20
  class VariableStore
21
21
  @data = {}
@@ -16,6 +16,6 @@
16
16
 
17
17
  module Fluent
18
18
 
19
- VERSION = '1.17.1'
19
+ VERSION = '1.19.0'
20
20
 
21
21
  end
data/lib/fluent/winsvc.rb CHANGED
@@ -32,7 +32,7 @@ begin
32
32
  op.parse(ARGV)
33
33
  if opts[:service_name] == nil
34
34
  raise "Error: No Windows Service name set. Use '--service-name'"
35
- end
35
+ end
36
36
 
37
37
  def read_fluentdopt(service_name)
38
38
  Win32::Registry::HKEY_LOCAL_MACHINE.open("SYSTEM\\CurrentControlSet\\Services\\#{service_name}") do |reg|
@@ -48,25 +48,32 @@ begin
48
48
  end
49
49
 
50
50
  class FluentdService < Daemon
51
+ ERROR_WAIT_NO_CHILDREN = 128
52
+
51
53
  @pid = 0
52
54
  @service_name = ''
53
55
 
54
56
  def initialize(service_name)
55
57
  @service_name = service_name
56
58
  end
57
-
59
+
58
60
  def service_main
59
61
  @pid = service_main_start(@service_name)
60
- while running?
61
- sleep 10
62
+ begin
63
+ loop do
64
+ sleep 5
65
+ break unless running?
66
+ raise Errno::ECHILD if Process.waitpid(@pid, Process::WNOHANG)
67
+ end
68
+ rescue Errno::ECHILD
69
+ @pid = 0
70
+ SetEvent(@@hStopEvent)
71
+ SetTheServiceStatus.call(SERVICE_STOPPED, ERROR_WAIT_NO_CHILDREN, 0, 0)
62
72
  end
63
73
  end
64
74
 
65
75
  def service_stop
66
- set_event(@service_name)
67
- if @pid > 0
68
- Process.waitpid(@pid)
69
- end
76
+ wait_supervisor_finished if @pid > 0
70
77
  end
71
78
 
72
79
  def service_paramchange
@@ -91,6 +98,29 @@ begin
91
98
  ev.set
92
99
  ev.close
93
100
  end
101
+
102
+ def repeat_set_event_several_times_until_success(event_name)
103
+ retries = 0
104
+ max_retries = 10
105
+ delay_sec = 3
106
+
107
+ begin
108
+ set_event(event_name)
109
+ rescue Errno::ENOENT
110
+ # This error occurs when the supervisor process has not yet created the event.
111
+ # If STOP is immediately executed, this state will occur.
112
+ # Retry `set_event' to wait for the initialization of the supervisor.
113
+ retries += 1
114
+ raise if max_retries < retries
115
+ sleep(delay_sec)
116
+ retry
117
+ end
118
+ end
119
+
120
+ def wait_supervisor_finished
121
+ repeat_set_event_several_times_until_success(@service_name)
122
+ Process.waitpid(@pid)
123
+ end
94
124
  end
95
125
 
96
126
  FluentdService.new(opts[:service_name]).mainloop
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.17.1
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-08-19 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,33 +458,19 @@ dependencies:
389
458
  - !ruby/object:Gem::Version
390
459
  version: '4'
391
460
  - !ruby/object:Gem::Dependency
392
- name: async
461
+ name: console
393
462
  requirement: !ruby/object:Gem::Requirement
394
463
  requirements:
395
464
  - - "~>"
396
465
  - !ruby/object:Gem::Version
397
- version: '1.23'
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: '1.23'
405
- - !ruby/object:Gem::Dependency
406
- name: async-http
407
- requirement: !ruby/object:Gem::Requirement
408
- requirements:
409
- - - ">="
410
- - !ruby/object:Gem::Version
411
- version: 0.50.0
412
- type: :development
413
- prerelease: false
414
- version_requirements: !ruby/object:Gem::Requirement
415
- requirements:
416
- - - ">="
417
- - !ruby/object:Gem::Version
418
- version: 0.50.0
473
+ version: '1.30'
419
474
  - !ruby/object:Gem::Dependency
420
475
  name: aws-sigv4
421
476
  requirement: !ruby/object:Gem::Requirement
@@ -477,6 +532,7 @@ extensions: []
477
532
  extra_rdoc_files: []
478
533
  files:
479
534
  - ".deepsource.toml"
535
+ - ".rubocop.yml"
480
536
  - ADOPTERS.md
481
537
  - AUTHORS
482
538
  - CHANGELOG.md
@@ -671,6 +727,7 @@ files:
671
727
  - lib/fluent/plugin/metrics.rb
672
728
  - lib/fluent/plugin/metrics_local.rb
673
729
  - lib/fluent/plugin/multi_output.rb
730
+ - lib/fluent/plugin/out_buffer.rb
674
731
  - lib/fluent/plugin/out_copy.rb
675
732
  - lib/fluent/plugin/out_exec.rb
676
733
  - lib/fluent/plugin/out_exec_filter.rb
@@ -725,9 +782,6 @@ files:
725
782
  - lib/fluent/plugin_helper/formatter.rb
726
783
  - lib/fluent/plugin_helper/http_server.rb
727
784
  - lib/fluent/plugin_helper/http_server/app.rb
728
- - lib/fluent/plugin_helper/http_server/compat/server.rb
729
- - lib/fluent/plugin_helper/http_server/compat/ssl_context_extractor.rb
730
- - lib/fluent/plugin_helper/http_server/compat/webrick_handler.rb
731
785
  - lib/fluent/plugin_helper/http_server/methods.rb
732
786
  - lib/fluent/plugin_helper/http_server/request.rb
733
787
  - lib/fluent/plugin_helper/http_server/router.rb
@@ -752,6 +806,7 @@ files:
752
806
  - lib/fluent/registry.rb
753
807
  - lib/fluent/root_agent.rb
754
808
  - lib/fluent/rpc.rb
809
+ - lib/fluent/source_only_buffer_agent.rb
755
810
  - lib/fluent/static_config_analysis.rb
756
811
  - lib/fluent/supervisor.rb
757
812
  - lib/fluent/system_config.rb
@@ -809,8 +864,11 @@ files:
809
864
  homepage: https://www.fluentd.org/
810
865
  licenses:
811
866
  - Apache-2.0
812
- metadata: {}
813
- 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
814
872
  rdoc_options: []
815
873
  require_paths:
816
874
  - lib
@@ -818,15 +876,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
818
876
  requirements:
819
877
  - - ">="
820
878
  - !ruby/object:Gem::Version
821
- version: '2.7'
879
+ version: '3.2'
822
880
  required_rubygems_version: !ruby/object:Gem::Requirement
823
881
  requirements:
824
882
  - - ">="
825
883
  - !ruby/object:Gem::Version
826
884
  version: '0'
827
885
  requirements: []
828
- rubygems_version: 3.4.19
829
- signing_key:
886
+ rubygems_version: 3.6.8
830
887
  specification_version: 4
831
888
  summary: Fluentd event collector
832
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