fluentd 1.14.4 → 1.15.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/.github/ISSUE_TEMPLATE/config.yml +2 -2
- data/.github/workflows/linux-test.yaml +1 -1
- data/.github/workflows/macos-test.yaml +5 -1
- data/.github/workflows/windows-test.yaml +9 -6
- data/CHANGELOG.md +115 -19
- data/CONTRIBUTING.md +1 -1
- data/MAINTAINERS.md +2 -2
- data/README.md +2 -23
- data/Rakefile +1 -1
- data/fluentd.gemspec +3 -1
- data/lib/fluent/command/ctl.rb +4 -1
- data/lib/fluent/command/fluentd.rb +14 -0
- data/lib/fluent/config/error.rb +12 -0
- data/lib/fluent/config/literal_parser.rb +2 -2
- data/lib/fluent/config/yaml_parser/fluent_value.rb +47 -0
- data/lib/fluent/config/yaml_parser/loader.rb +91 -0
- data/lib/fluent/config/yaml_parser/parser.rb +166 -0
- data/lib/fluent/config/yaml_parser/section_builder.rb +107 -0
- data/lib/fluent/config/yaml_parser.rb +56 -0
- data/lib/fluent/config.rb +14 -1
- data/lib/fluent/event_router.rb +19 -1
- data/lib/fluent/plugin/bare_output.rb +1 -1
- data/lib/fluent/plugin/base.rb +1 -1
- data/lib/fluent/plugin/file_wrapper.rb +52 -107
- data/lib/fluent/plugin/in_forward.rb +1 -1
- data/lib/fluent/plugin/in_http.rb +11 -1
- data/lib/fluent/plugin/in_tail/group_watch.rb +204 -0
- data/lib/fluent/plugin/in_tail/position_file.rb +1 -15
- data/lib/fluent/plugin/in_tail.rb +66 -47
- data/lib/fluent/plugin/out_forward/socket_cache.rb +2 -0
- data/lib/fluent/plugin/output.rb +43 -33
- data/lib/fluent/plugin/parser.rb +3 -4
- data/lib/fluent/plugin/parser_syslog.rb +1 -1
- data/lib/fluent/plugin_helper/retry_state.rb +14 -4
- data/lib/fluent/plugin_helper/server.rb +23 -4
- data/lib/fluent/plugin_helper/service_discovery.rb +2 -2
- data/lib/fluent/plugin_helper/socket.rb +13 -2
- data/lib/fluent/registry.rb +2 -1
- data/lib/fluent/rpc.rb +4 -3
- data/lib/fluent/supervisor.rb +114 -27
- data/lib/fluent/system_config.rb +2 -1
- data/lib/fluent/version.rb +1 -1
- data/lib/fluent/winsvc.rb +2 -0
- data/test/command/test_ctl.rb +0 -1
- data/test/command/test_fluentd.rb +33 -0
- data/test/compat/test_parser.rb +1 -1
- data/test/config/test_system_config.rb +3 -1
- data/test/config/test_types.rb +1 -1
- data/test/plugin/in_tail/test_io_handler.rb +14 -4
- data/test/plugin/in_tail/test_position_file.rb +0 -63
- data/test/plugin/out_forward/test_socket_cache.rb +26 -1
- data/test/plugin/test_file_wrapper.rb +0 -68
- data/test/plugin/test_filter_parser.rb +1 -1
- data/test/plugin/test_filter_stdout.rb +2 -2
- data/test/plugin/test_in_forward.rb +0 -2
- data/test/plugin/test_in_http.rb +23 -0
- data/test/plugin/test_in_object_space.rb +9 -3
- data/test/plugin/test_in_syslog.rb +1 -1
- data/test/plugin/test_in_tail.rb +629 -353
- data/test/plugin/test_out_forward.rb +30 -20
- data/test/plugin/test_out_stdout.rb +2 -2
- data/test/plugin/test_output_as_buffered_retries.rb +53 -6
- data/test/plugin/test_output_as_buffered_secondary.rb +1 -1
- data/test/plugin/test_parser_syslog.rb +1 -1
- data/test/plugin_helper/test_cert_option.rb +1 -1
- data/test/plugin_helper/test_child_process.rb +16 -4
- data/test/plugin_helper/test_retry_state.rb +602 -38
- data/test/plugin_helper/test_server.rb +18 -0
- data/test/test_config.rb +135 -4
- data/test/test_event_router.rb +17 -0
- data/test/test_formatter.rb +1 -1
- data/test/test_supervisor.rb +196 -6
- metadata +25 -5
@@ -64,6 +64,24 @@ class ServerPluginHelperTest < Test::Unit::TestCase
|
|
64
64
|
end
|
65
65
|
assert d.plugin_id
|
66
66
|
assert d.log
|
67
|
+
assert_equal 0, d.transport_config.linger_timeout
|
68
|
+
end
|
69
|
+
|
70
|
+
test 'can change linger_timeout option' do
|
71
|
+
d = Dummy.new
|
72
|
+
|
73
|
+
transport_opts = {
|
74
|
+
'linger_timeout' => 1,
|
75
|
+
}
|
76
|
+
transport_conf = config_element('transport', 'tcp', transport_opts)
|
77
|
+
conf = config_element('source', 'tag.*', {}, [transport_conf])
|
78
|
+
|
79
|
+
assert_nothing_raised do
|
80
|
+
d.configure(conf)
|
81
|
+
end
|
82
|
+
assert d.plugin_id
|
83
|
+
assert d.log
|
84
|
+
assert_equal 1, d.transport_config.linger_timeout
|
67
85
|
end
|
68
86
|
end
|
69
87
|
|
data/test/test_config.rb
CHANGED
@@ -10,11 +10,18 @@ class ConfigTest < Test::Unit::TestCase
|
|
10
10
|
|
11
11
|
TMP_DIR = File.dirname(__FILE__) + "/tmp/config#{ENV['TEST_ENV_NUMBER']}"
|
12
12
|
|
13
|
-
def read_config(path)
|
13
|
+
def read_config(path, use_yaml: false)
|
14
14
|
path = File.expand_path(path)
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
if use_yaml
|
16
|
+
context = Kernel.binding
|
17
|
+
|
18
|
+
s = Fluent::Config::YamlParser::Loader.new(context).load(Pathname.new(path))
|
19
|
+
Fluent::Config::YamlParser::Parser.new(s).build.to_element
|
20
|
+
else
|
21
|
+
File.open(path) { |io|
|
22
|
+
Fluent::Config::Parser.parse(io, File.basename(path), File.dirname(path))
|
23
|
+
}
|
24
|
+
end
|
18
25
|
end
|
19
26
|
|
20
27
|
def prepare_config
|
@@ -151,6 +158,130 @@ class ConfigTest < Test::Unit::TestCase
|
|
151
158
|
assert_equal before_size, match_conf.unused.size
|
152
159
|
end
|
153
160
|
|
161
|
+
sub_test_case "yaml config" do
|
162
|
+
def test_included
|
163
|
+
write_config "#{TMP_DIR}/config_test_not_fetched.yaml", <<-EOS
|
164
|
+
config:
|
165
|
+
- source:
|
166
|
+
$type: dummy
|
167
|
+
tag: tag.dummy
|
168
|
+
- source:
|
169
|
+
$type: tcp
|
170
|
+
tag: tag.tcp
|
171
|
+
parse:
|
172
|
+
$arg:
|
173
|
+
- why.parse.section.doesnot.have.arg
|
174
|
+
- huh
|
175
|
+
$type: none
|
176
|
+
- match:
|
177
|
+
$tag: tag.*
|
178
|
+
$type: stdout
|
179
|
+
buffer:
|
180
|
+
$type: memory
|
181
|
+
flush_interval: 1s
|
182
|
+
- !include fluent-included.yaml
|
183
|
+
EOS
|
184
|
+
write_config "#{TMP_DIR}/fluent-included.yaml", <<-EOS
|
185
|
+
- label:
|
186
|
+
$name: '@FLUENT_LOG'
|
187
|
+
config:
|
188
|
+
- match:
|
189
|
+
$type: "null"
|
190
|
+
$tag: "**"
|
191
|
+
buffer:
|
192
|
+
$type: memory
|
193
|
+
flush_mode: interval
|
194
|
+
flush_interval: 1s
|
195
|
+
EOS
|
196
|
+
root_conf = read_config("#{TMP_DIR}/config_test_not_fetched.yaml", use_yaml: true)
|
197
|
+
dummy_source_conf = root_conf.elements.first
|
198
|
+
tcp_source_conf = root_conf.elements[1]
|
199
|
+
parse_tcp_conf = tcp_source_conf.elements.first
|
200
|
+
match_conf = root_conf.elements[2]
|
201
|
+
label_conf = root_conf.elements[3]
|
202
|
+
fluent_log_conf = label_conf.elements.first
|
203
|
+
fluent_log_buffer_conf = fluent_log_conf.elements.first
|
204
|
+
|
205
|
+
assert_equal(
|
206
|
+
[
|
207
|
+
'dummy',
|
208
|
+
'tag.dummy',
|
209
|
+
'tcp',
|
210
|
+
'tag.tcp',
|
211
|
+
'none',
|
212
|
+
'why.parse.section.doesnot.have.arg,huh',
|
213
|
+
'stdout',
|
214
|
+
'tag.*',
|
215
|
+
'null',
|
216
|
+
'**',
|
217
|
+
'@FLUENT_LOG',
|
218
|
+
'memory',
|
219
|
+
'interval',
|
220
|
+
'1s',
|
221
|
+
],
|
222
|
+
[
|
223
|
+
dummy_source_conf['@type'],
|
224
|
+
dummy_source_conf['tag'],
|
225
|
+
tcp_source_conf['@type'],
|
226
|
+
tcp_source_conf['tag'],
|
227
|
+
parse_tcp_conf['@type'],
|
228
|
+
parse_tcp_conf.arg,
|
229
|
+
match_conf['@type'],
|
230
|
+
match_conf.arg,
|
231
|
+
fluent_log_conf['@type'],
|
232
|
+
fluent_log_conf.arg,
|
233
|
+
label_conf.arg,
|
234
|
+
fluent_log_buffer_conf['@type'],
|
235
|
+
fluent_log_buffer_conf['flush_mode'],
|
236
|
+
fluent_log_buffer_conf['flush_interval'],
|
237
|
+
])
|
238
|
+
end
|
239
|
+
|
240
|
+
def test_check_not_fetchd
|
241
|
+
write_config "#{TMP_DIR}/config_test_not_fetched.yaml", <<-EOS
|
242
|
+
config:
|
243
|
+
- match:
|
244
|
+
$arg: dummy
|
245
|
+
$type: rewrite
|
246
|
+
add_prefix: filtered
|
247
|
+
rule:
|
248
|
+
key: path
|
249
|
+
pattern: "^[A-Z]+"
|
250
|
+
replace: true
|
251
|
+
EOS
|
252
|
+
root_conf = read_config("#{TMP_DIR}/config_test_not_fetched.yaml", use_yaml: true)
|
253
|
+
match_conf = root_conf.elements.first
|
254
|
+
rule_conf = match_conf.elements.first
|
255
|
+
|
256
|
+
not_fetched = []; root_conf.check_not_fetched {|key, e| not_fetched << key }
|
257
|
+
assert_equal %w[@type $arg add_prefix key pattern replace], not_fetched
|
258
|
+
|
259
|
+
not_fetched = []; match_conf.check_not_fetched {|key, e| not_fetched << key }
|
260
|
+
assert_equal %w[@type $arg add_prefix key pattern replace], not_fetched
|
261
|
+
|
262
|
+
not_fetched = []; rule_conf.check_not_fetched {|key, e| not_fetched << key }
|
263
|
+
assert_equal %w[key pattern replace], not_fetched
|
264
|
+
|
265
|
+
# accessing should delete
|
266
|
+
match_conf['type']
|
267
|
+
rule_conf['key']
|
268
|
+
|
269
|
+
not_fetched = []; root_conf.check_not_fetched {|key, e| not_fetched << key }
|
270
|
+
assert_equal %w[@type $arg add_prefix pattern replace], not_fetched
|
271
|
+
|
272
|
+
not_fetched = []; match_conf.check_not_fetched {|key, e| not_fetched << key }
|
273
|
+
assert_equal %w[@type $arg add_prefix pattern replace], not_fetched
|
274
|
+
|
275
|
+
not_fetched = []; rule_conf.check_not_fetched {|key, e| not_fetched << key }
|
276
|
+
assert_equal %w[pattern replace], not_fetched
|
277
|
+
|
278
|
+
# repeatedly accessing should not grow memory usage
|
279
|
+
before_size = match_conf.unused.size
|
280
|
+
10.times { match_conf['type'] }
|
281
|
+
assert_equal before_size, match_conf.unused.size
|
282
|
+
end
|
283
|
+
end
|
284
|
+
|
154
285
|
def write_config(path, data, encoding: 'utf-8')
|
155
286
|
FileUtils.mkdir_p(File.dirname(path))
|
156
287
|
File.open(path, "w:#{encoding}:utf-8") {|f| f.write data }
|
data/test/test_event_router.rb
CHANGED
@@ -326,6 +326,23 @@ class EventRouterTest < ::Test::Unit::TestCase
|
|
326
326
|
event_router.emit('test', Engine.now, 'k' => 'v')
|
327
327
|
end
|
328
328
|
end
|
329
|
+
|
330
|
+
test 'can pass records modified by filters to handle_emits_error' do
|
331
|
+
filter = Class.new(FluentTestFilter) {
|
332
|
+
def filter_stream(_tag, es); end
|
333
|
+
}.new
|
334
|
+
event_router.add_rule('test', filter)
|
335
|
+
event_router.add_rule('test', error_output)
|
336
|
+
|
337
|
+
time = Engine.now
|
338
|
+
modified_es = OneEventStream.new(time, 'modified_label' => 'modified_value')
|
339
|
+
|
340
|
+
assert_rr do
|
341
|
+
stub(filter).filter_stream { modified_es }
|
342
|
+
mock(emit_handler).handle_emits_error('test', modified_es, is_a(RuntimeError))
|
343
|
+
event_router.emit('test', time, 'pre_label' => 'pre_value')
|
344
|
+
end
|
345
|
+
end
|
329
346
|
end
|
330
347
|
end
|
331
348
|
end
|
data/test/test_formatter.rb
CHANGED
data/test/test_supervisor.rb
CHANGED
@@ -90,6 +90,93 @@ class SupervisorTest < ::Test::Unit::TestCase
|
|
90
90
|
assert_equal 2, counter_client.timeout
|
91
91
|
end
|
92
92
|
|
93
|
+
sub_test_case "yaml config" do
|
94
|
+
def parse_yaml(yaml)
|
95
|
+
context = Kernel.binding
|
96
|
+
|
97
|
+
config = nil
|
98
|
+
Tempfile.open do |file|
|
99
|
+
file.puts(yaml)
|
100
|
+
file.flush
|
101
|
+
s = Fluent::Config::YamlParser::Loader.new(context).load(Pathname.new(file))
|
102
|
+
config = Fluent::Config::YamlParser::Parser.new(s).build.to_element
|
103
|
+
end
|
104
|
+
config
|
105
|
+
end
|
106
|
+
|
107
|
+
def test_system_config
|
108
|
+
opts = Fluent::Supervisor.default_options
|
109
|
+
sv = Fluent::Supervisor.new(opts)
|
110
|
+
conf_data = <<-EOC
|
111
|
+
system:
|
112
|
+
rpc_endpoint: 127.0.0.1:24445
|
113
|
+
suppress_repeated_stacktrace: true
|
114
|
+
suppress_config_dump: true
|
115
|
+
without_source: true
|
116
|
+
enable_get_dump: true
|
117
|
+
process_name: "process_name"
|
118
|
+
log_level: info
|
119
|
+
root_dir: !fluent/s "#{TMP_ROOT_DIR}"
|
120
|
+
log:
|
121
|
+
format: json
|
122
|
+
time_format: "%Y"
|
123
|
+
counter_server:
|
124
|
+
bind: 127.0.0.1
|
125
|
+
port: 24321
|
126
|
+
scope: server1
|
127
|
+
backup_path: /tmp/backup
|
128
|
+
counter_client:
|
129
|
+
host: 127.0.0.1
|
130
|
+
port: 24321
|
131
|
+
timeout: 2
|
132
|
+
EOC
|
133
|
+
conf = parse_yaml(conf_data)
|
134
|
+
sys_conf = sv.__send__(:build_system_config, conf)
|
135
|
+
|
136
|
+
counter_client = sys_conf.counter_client
|
137
|
+
counter_server = sys_conf.counter_server
|
138
|
+
assert_equal(
|
139
|
+
[
|
140
|
+
'127.0.0.1:24445',
|
141
|
+
true,
|
142
|
+
true,
|
143
|
+
true,
|
144
|
+
true,
|
145
|
+
"process_name",
|
146
|
+
2,
|
147
|
+
TMP_ROOT_DIR,
|
148
|
+
:json,
|
149
|
+
'%Y',
|
150
|
+
'127.0.0.1',
|
151
|
+
24321,
|
152
|
+
'server1',
|
153
|
+
'/tmp/backup',
|
154
|
+
'127.0.0.1',
|
155
|
+
24321,
|
156
|
+
2,
|
157
|
+
],
|
158
|
+
[
|
159
|
+
sys_conf.rpc_endpoint,
|
160
|
+
sys_conf.suppress_repeated_stacktrace,
|
161
|
+
sys_conf.suppress_config_dump,
|
162
|
+
sys_conf.without_source,
|
163
|
+
sys_conf.enable_get_dump,
|
164
|
+
sys_conf.process_name,
|
165
|
+
sys_conf.log_level,
|
166
|
+
sys_conf.root_dir,
|
167
|
+
sys_conf.log.format,
|
168
|
+
sys_conf.log.time_format,
|
169
|
+
counter_server.bind,
|
170
|
+
counter_server.port,
|
171
|
+
counter_server.scope,
|
172
|
+
counter_server.backup_path,
|
173
|
+
counter_client.host,
|
174
|
+
counter_client.port,
|
175
|
+
counter_client.timeout,
|
176
|
+
])
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
93
180
|
def test_main_process_signal_handlers
|
94
181
|
omit "Windows cannot handle signals" if Fluent.windows?
|
95
182
|
|
@@ -213,16 +300,65 @@ class SupervisorTest < ::Test::Unit::TestCase
|
|
213
300
|
$log.out.reset if $log && $log.out && $log.out.respond_to?(:reset)
|
214
301
|
end
|
215
302
|
|
216
|
-
|
303
|
+
data("Normal", {raw_path: "C:\\Windows\\Temp\\sigdump.log", expected: "C:\\Windows\\Temp\\sigdump-#{$$}.log"})
|
304
|
+
data("UNIX style", {raw_path: "/Windows/Temp/sigdump.log", expected: "/Windows/Temp/sigdump-#{$$}.log"})
|
305
|
+
data("No extension", {raw_path: "C:\\Windows\\Temp\\sigdump", expected: "C:\\Windows\\Temp\\sigdump-#{$$}"})
|
306
|
+
data("Multi-extension", {raw_path: "C:\\Windows\\Temp\\sig.dump.bk", expected: "C:\\Windows\\Temp\\sig.dump-#{$$}.bk"})
|
307
|
+
def test_fluentsigdump_get_path_with_pid(data)
|
308
|
+
p data
|
309
|
+
path = Fluent::FluentSigdump.get_path_with_pid(data[:raw_path])
|
310
|
+
assert_equal(data[:expected], path)
|
311
|
+
end
|
312
|
+
|
313
|
+
def test_supervisor_event_dump_windows
|
314
|
+
omit "Only for Windows, alternative to UNIX signals" unless Fluent.windows?
|
315
|
+
|
316
|
+
server = DummyServer.new
|
317
|
+
def server.config
|
318
|
+
{:signame => "TestFluentdEvent"}
|
319
|
+
end
|
320
|
+
server.install_windows_event_handler
|
321
|
+
|
322
|
+
assert_rr do
|
323
|
+
# Have to use mock because `Sigdump.dump` seems to be somehow incompatible with RR.
|
324
|
+
# The `mock(server).restart(true) { nil }` line in `test_rpc_server_windows` cause the next error.
|
325
|
+
# Failure: test_supervisor_event_dump_windows(SupervisorTest):
|
326
|
+
# class()
|
327
|
+
# Called 0 times.
|
328
|
+
# Expected 1 times.
|
329
|
+
# .../Ruby26-x64/lib/ruby/gems/2.6.0/gems/sigdump-0.2.4/lib/sigdump.rb:74:in `block in dump_object_count'
|
330
|
+
# 73: ObjectSpace.each_object {|o|
|
331
|
+
# 74: c = o.class <-- HERE!
|
332
|
+
mock(Sigdump).dump(anything)
|
333
|
+
|
334
|
+
begin
|
335
|
+
sleep 0.1 # Wait for starting windows event thread
|
336
|
+
event = Win32::Event.open("TestFluentdEvent_CONT")
|
337
|
+
event.set
|
338
|
+
event.close
|
339
|
+
sleep 1.0 # Wait for dumping
|
340
|
+
ensure
|
341
|
+
server.stop_windows_event_thread
|
342
|
+
end
|
343
|
+
end
|
344
|
+
end
|
345
|
+
|
346
|
+
data(:ipv4 => ["0.0.0.0", "127.0.0.1", false],
|
347
|
+
:ipv6 => ["[::]", "[::1]", true],
|
348
|
+
:localhost_ipv4 => ["localhost", "127.0.0.1", false])
|
349
|
+
def test_rpc_server(data)
|
217
350
|
omit "Windows cannot handle signals" if Fluent.windows?
|
218
351
|
|
352
|
+
bindaddr, localhost, ipv6 = data
|
353
|
+
omit "IPv6 is not supported on this environment" if ipv6 && !ipv6_enabled?
|
354
|
+
|
219
355
|
create_info_dummy_logger
|
220
356
|
|
221
357
|
opts = Fluent::Supervisor.default_options
|
222
358
|
sv = Fluent::Supervisor.new(opts)
|
223
359
|
conf_data = <<-EOC
|
224
360
|
<system>
|
225
|
-
rpc_endpoint
|
361
|
+
rpc_endpoint "#{bindaddr}:24447"
|
226
362
|
</system>
|
227
363
|
EOC
|
228
364
|
conf = Fluent::Config.parse(conf_data, "(test)", "(test_dir)", true)
|
@@ -235,7 +371,7 @@ class SupervisorTest < ::Test::Unit::TestCase
|
|
235
371
|
server.run_rpc_server
|
236
372
|
|
237
373
|
sv.send(:install_main_process_signal_handlers)
|
238
|
-
response = Net::HTTP.get(URI.parse(
|
374
|
+
response = Net::HTTP.get(URI.parse("http://#{localhost}:24447/api/plugins.flushBuffers"))
|
239
375
|
info_msg = '[info]: force flushing buffered events' + "\n"
|
240
376
|
|
241
377
|
server.stop_rpc_server
|
@@ -250,16 +386,45 @@ class SupervisorTest < ::Test::Unit::TestCase
|
|
250
386
|
$log.out.reset if $log.out.is_a?(Fluent::Test::DummyLogDevice)
|
251
387
|
end
|
252
388
|
|
253
|
-
|
389
|
+
data(:no_port => ["127.0.0.1"],
|
390
|
+
:invalid_addr => ["*:24447"])
|
391
|
+
def test_invalid_rpc_endpoint(data)
|
392
|
+
endpoint = data[0]
|
393
|
+
|
394
|
+
opts = Fluent::Supervisor.default_options
|
395
|
+
sv = Fluent::Supervisor.new(opts)
|
396
|
+
conf_data = <<-EOC
|
397
|
+
<system>
|
398
|
+
rpc_endpoint "#{endpoint}"
|
399
|
+
</system>
|
400
|
+
EOC
|
401
|
+
conf = Fluent::Config.parse(conf_data, "(test)", "(test_dir)", true)
|
402
|
+
sys_conf = sv.__send__(:build_system_config, conf)
|
403
|
+
|
404
|
+
server = DummyServer.new
|
405
|
+
server.rpc_endpoint = sys_conf.rpc_endpoint
|
406
|
+
|
407
|
+
assert_raise(Fluent::ConfigError.new("Invalid rpc_endpoint: #{endpoint}")) do
|
408
|
+
server.run_rpc_server
|
409
|
+
end
|
410
|
+
end
|
411
|
+
|
412
|
+
data(:ipv4 => ["0.0.0.0", "127.0.0.1", false],
|
413
|
+
:ipv6 => ["[::]", "[::1]", true],
|
414
|
+
:localhost_ipv4 => ["localhost", "127.0.0.1", true])
|
415
|
+
def test_rpc_server_windows(data)
|
254
416
|
omit "Only for windows platform" unless Fluent.windows?
|
255
417
|
|
418
|
+
bindaddr, localhost, ipv6 = data
|
419
|
+
omit "IPv6 is not supported on this environment" if ipv6 && !ipv6_enabled?
|
420
|
+
|
256
421
|
create_info_dummy_logger
|
257
422
|
|
258
423
|
opts = Fluent::Supervisor.default_options
|
259
424
|
sv = Fluent::Supervisor.new(opts)
|
260
425
|
conf_data = <<-EOC
|
261
426
|
<system>
|
262
|
-
rpc_endpoint
|
427
|
+
rpc_endpoint "#{bindaddr}:24447"
|
263
428
|
</system>
|
264
429
|
EOC
|
265
430
|
conf = Fluent::Config.parse(conf_data, "(test)", "(test_dir)", true)
|
@@ -277,7 +442,7 @@ class SupervisorTest < ::Test::Unit::TestCase
|
|
277
442
|
server.run_rpc_server
|
278
443
|
|
279
444
|
mock(server).restart(true) { nil }
|
280
|
-
response = Net::HTTP.get(URI.parse(
|
445
|
+
response = Net::HTTP.get(URI.parse("http://#{localhost}:24447/api/plugins.flushBuffers"))
|
281
446
|
|
282
447
|
server.stop_rpc_server
|
283
448
|
assert_equal('{"ok":true}', response)
|
@@ -522,6 +687,31 @@ class SupervisorTest < ::Test::Unit::TestCase
|
|
522
687
|
logger.instance_variable_get(:@rotate_size)])
|
523
688
|
end
|
524
689
|
end
|
690
|
+
|
691
|
+
def test_override_default_log_rotate_with_yaml_config
|
692
|
+
Tempfile.open do |file|
|
693
|
+
config = <<-EOS
|
694
|
+
system:
|
695
|
+
log:
|
696
|
+
rotate_age: 3
|
697
|
+
rotate_size: 300
|
698
|
+
EOS
|
699
|
+
file.puts(config)
|
700
|
+
file.flush
|
701
|
+
opts = Fluent::Supervisor.default_options.merge(
|
702
|
+
log_path: "#{TMP_DIR}/test.log", config_path: file.path, config_file_type: :yaml,
|
703
|
+
)
|
704
|
+
sv = Fluent::Supervisor.new(opts)
|
705
|
+
|
706
|
+
log = sv.instance_variable_get(:@log)
|
707
|
+
log.init(:standalone, 0)
|
708
|
+
logger = $log.instance_variable_get(:@logger)
|
709
|
+
|
710
|
+
assert_equal([3, 300],
|
711
|
+
[logger.instance_variable_get(:@rotate_age),
|
712
|
+
logger.instance_variable_get(:@rotate_size)])
|
713
|
+
end
|
714
|
+
end
|
525
715
|
end
|
526
716
|
|
527
717
|
def test_inline_config
|
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.
|
4
|
+
version: 1.15.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: 2022-
|
11
|
+
date: 2022-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,7 +84,7 @@ dependencies:
|
|
84
84
|
requirements:
|
85
85
|
- - ">="
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: 2.
|
87
|
+
version: 2.3.0
|
88
88
|
- - "<"
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: 3.0.0
|
@@ -94,7 +94,7 @@ dependencies:
|
|
94
94
|
requirements:
|
95
95
|
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: 2.
|
97
|
+
version: 2.3.0
|
98
98
|
- - "<"
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: 3.0.0
|
@@ -338,6 +338,20 @@ dependencies:
|
|
338
338
|
- - "<"
|
339
339
|
- !ruby/object:Gem::Version
|
340
340
|
version: '4'
|
341
|
+
- !ruby/object:Gem::Dependency
|
342
|
+
name: async
|
343
|
+
requirement: !ruby/object:Gem::Requirement
|
344
|
+
requirements:
|
345
|
+
- - "~>"
|
346
|
+
- !ruby/object:Gem::Version
|
347
|
+
version: '1.23'
|
348
|
+
type: :development
|
349
|
+
prerelease: false
|
350
|
+
version_requirements: !ruby/object:Gem::Requirement
|
351
|
+
requirements:
|
352
|
+
- - "~>"
|
353
|
+
- !ruby/object:Gem::Version
|
354
|
+
version: '1.23'
|
341
355
|
- !ruby/object:Gem::Dependency
|
342
356
|
name: async-http
|
343
357
|
requirement: !ruby/object:Gem::Requirement
|
@@ -493,6 +507,11 @@ files:
|
|
493
507
|
- lib/fluent/config/section.rb
|
494
508
|
- lib/fluent/config/types.rb
|
495
509
|
- lib/fluent/config/v1_parser.rb
|
510
|
+
- lib/fluent/config/yaml_parser.rb
|
511
|
+
- lib/fluent/config/yaml_parser/fluent_value.rb
|
512
|
+
- lib/fluent/config/yaml_parser/loader.rb
|
513
|
+
- lib/fluent/config/yaml_parser/parser.rb
|
514
|
+
- lib/fluent/config/yaml_parser/section_builder.rb
|
496
515
|
- lib/fluent/configurable.rb
|
497
516
|
- lib/fluent/counter.rb
|
498
517
|
- lib/fluent/counter/base_socket.rb
|
@@ -565,6 +584,7 @@ files:
|
|
565
584
|
- lib/fluent/plugin/in_sample.rb
|
566
585
|
- lib/fluent/plugin/in_syslog.rb
|
567
586
|
- lib/fluent/plugin/in_tail.rb
|
587
|
+
- lib/fluent/plugin/in_tail/group_watch.rb
|
568
588
|
- lib/fluent/plugin/in_tail/position_file.rb
|
569
589
|
- lib/fluent/plugin/in_tcp.rb
|
570
590
|
- lib/fluent/plugin/in_udp.rb
|
@@ -945,7 +965,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
945
965
|
- !ruby/object:Gem::Version
|
946
966
|
version: '0'
|
947
967
|
requirements: []
|
948
|
-
rubygems_version: 3.
|
968
|
+
rubygems_version: 3.3.5
|
949
969
|
signing_key:
|
950
970
|
specification_version: 4
|
951
971
|
summary: Fluentd event collector
|