fluentd 1.16.0 → 1.16.7
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/.github/ISSUE_TEMPLATE/{bug_report.yaml → bug_report.yml} +1 -0
- data/.github/ISSUE_TEMPLATE/{feature_request.yaml → feature_request.yml} +1 -0
- data/.github/workflows/stale-actions.yml +24 -0
- data/.github/workflows/test.yml +39 -0
- data/CHANGELOG.md +161 -0
- data/CONTRIBUTING.md +1 -1
- data/MAINTAINERS.md +3 -3
- data/README.md +0 -2
- data/SECURITY.md +5 -9
- data/fluentd.gemspec +10 -2
- data/lib/fluent/command/ctl.rb +2 -2
- data/lib/fluent/command/fluentd.rb +1 -1
- data/lib/fluent/command/plugin_config_formatter.rb +1 -1
- data/lib/fluent/config/dsl.rb +1 -1
- data/lib/fluent/config/v1_parser.rb +2 -2
- data/lib/fluent/config/yaml_parser/parser.rb +4 -0
- data/lib/fluent/counter/server.rb +1 -1
- data/lib/fluent/counter/validator.rb +3 -3
- data/lib/fluent/engine.rb +1 -1
- data/lib/fluent/event.rb +8 -4
- data/lib/fluent/log.rb +9 -0
- data/lib/fluent/match.rb +1 -1
- data/lib/fluent/msgpack_factory.rb +6 -1
- data/lib/fluent/plugin/base.rb +1 -1
- data/lib/fluent/plugin/buffer.rb +96 -87
- data/lib/fluent/plugin/filter_record_transformer.rb +1 -1
- data/lib/fluent/plugin/in_forward.rb +1 -1
- data/lib/fluent/plugin/in_http.rb +8 -8
- data/lib/fluent/plugin/in_sample.rb +1 -1
- data/lib/fluent/plugin/in_tail/position_file.rb +32 -18
- data/lib/fluent/plugin/in_tail.rb +99 -31
- data/lib/fluent/plugin/in_tcp.rb +43 -0
- data/lib/fluent/plugin/out_exec_filter.rb +2 -2
- data/lib/fluent/plugin/out_file.rb +8 -0
- data/lib/fluent/plugin/output.rb +2 -2
- data/lib/fluent/plugin/parser_json.rb +4 -12
- data/lib/fluent/plugin_helper/event_loop.rb +2 -2
- data/lib/fluent/plugin_helper/record_accessor.rb +1 -1
- data/lib/fluent/plugin_helper/server.rb +8 -0
- data/lib/fluent/plugin_helper/thread.rb +3 -3
- data/lib/fluent/plugin_id.rb +1 -1
- data/lib/fluent/supervisor.rb +2 -2
- data/lib/fluent/system_config.rb +1 -1
- data/lib/fluent/version.rb +1 -1
- data/lib/fluent/winsvc.rb +28 -3
- data/templates/new_gem/test/helper.rb.erb +0 -1
- data/test/command/test_cat.rb +2 -2
- data/test/command/test_fluentd.rb +65 -12
- data/test/config/test_system_config.rb +2 -2
- data/test/helper.rb +27 -7
- data/test/plugin/in_tail/test_io_handler.rb +13 -14
- data/test/plugin/in_tail/test_position_file.rb +37 -8
- data/test/plugin/out_forward/test_ack_handler.rb +3 -3
- data/test/plugin/out_forward/test_socket_cache.rb +3 -3
- data/test/plugin/test_base.rb +1 -1
- data/test/plugin/test_buffer.rb +110 -0
- data/test/plugin/test_buffer_chunk.rb +11 -0
- data/test/plugin/test_in_forward.rb +11 -10
- data/test/plugin/test_in_http.rb +1 -1
- data/test/plugin/test_in_monitor_agent.rb +6 -6
- data/test/plugin/test_in_syslog.rb +25 -18
- data/test/plugin/test_in_tail.rb +639 -0
- data/test/plugin/test_in_tcp.rb +75 -5
- data/test/plugin/test_in_udp.rb +35 -1
- data/test/plugin/test_in_unix.rb +2 -2
- data/test/plugin/test_multi_output.rb +1 -1
- data/test/plugin/test_out_exec_filter.rb +14 -9
- data/test/plugin/test_out_file.rb +24 -4
- data/test/plugin/test_out_forward.rb +36 -42
- data/test/plugin/test_out_stream.rb +1 -1
- data/test/plugin/test_output.rb +12 -12
- data/test/plugin/test_output_as_buffered.rb +44 -44
- data/test/plugin/test_output_as_buffered_compress.rb +32 -18
- data/test/plugin/test_output_as_buffered_retries.rb +1 -1
- data/test/plugin/test_output_as_buffered_secondary.rb +2 -2
- data/test/plugin/test_parser_json.rb +31 -0
- data/test/plugin_helper/test_child_process.rb +15 -5
- data/test/plugin_helper/test_http_server_helper.rb +1 -1
- data/test/plugin_helper/test_server.rb +110 -38
- data/test/plugin_helper/test_socket.rb +1 -1
- data/test/test_config.rb +6 -0
- data/test/test_event_router.rb +2 -2
- data/test/test_log.rb +38 -1
- data/test/test_msgpack_factory.rb +32 -0
- data/test/test_supervisor.rb +13 -0
- metadata +44 -17
- data/.github/workflows/linux-test.yaml +0 -36
- data/.github/workflows/macos-test.yaml +0 -34
- data/.github/workflows/windows-test.yaml +0 -49
|
@@ -5,24 +5,24 @@ require 'fluent/plugin/in_syslog'
|
|
|
5
5
|
class SyslogInputTest < Test::Unit::TestCase
|
|
6
6
|
def setup
|
|
7
7
|
Fluent::Test.setup
|
|
8
|
-
@port = unused_port
|
|
8
|
+
@port = unused_port(protocol: :udp)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def teardown
|
|
12
12
|
@port = nil
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def ipv4_config
|
|
15
|
+
def ipv4_config(port = @port)
|
|
16
16
|
%[
|
|
17
|
-
port #{
|
|
17
|
+
port #{port}
|
|
18
18
|
bind 127.0.0.1
|
|
19
19
|
tag syslog
|
|
20
20
|
]
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
def ipv6_config
|
|
23
|
+
def ipv6_config(port = @port)
|
|
24
24
|
%[
|
|
25
|
-
port #{
|
|
25
|
+
port #{port}
|
|
26
26
|
bind ::1
|
|
27
27
|
tag syslog
|
|
28
28
|
]
|
|
@@ -69,7 +69,8 @@ EOS
|
|
|
69
69
|
'Use transport and protocol' => ["protocol_type udp\n<transport tcp>\n </transport>", :udp, :tcp])
|
|
70
70
|
def test_configure_protocol(param)
|
|
71
71
|
conf, proto_type, transport_proto_type = *param
|
|
72
|
-
|
|
72
|
+
port = unused_port(protocol: proto_type ? proto_type : transport_proto_type)
|
|
73
|
+
d = create_driver([ipv4_config(port), conf].join("\n"))
|
|
73
74
|
|
|
74
75
|
assert_equal(d.instance.protocol_type, proto_type)
|
|
75
76
|
assert_equal(d.instance.transport_config.protocol, transport_proto_type)
|
|
@@ -158,12 +159,13 @@ EOS
|
|
|
158
159
|
end
|
|
159
160
|
|
|
160
161
|
def test_msg_size_with_tcp
|
|
161
|
-
|
|
162
|
+
port = unused_port(protocol: :tcp)
|
|
163
|
+
d = create_driver([ipv4_config(port), "<transport tcp> \n</transport>"].join("\n"))
|
|
162
164
|
tests = create_test_case
|
|
163
165
|
|
|
164
166
|
d.run(expect_emits: 2) do
|
|
165
167
|
tests.each {|test|
|
|
166
|
-
TCPSocket.open('127.0.0.1',
|
|
168
|
+
TCPSocket.open('127.0.0.1', port) do |s|
|
|
167
169
|
s.send(test['msg'], 0)
|
|
168
170
|
end
|
|
169
171
|
}
|
|
@@ -189,11 +191,12 @@ EOS
|
|
|
189
191
|
end
|
|
190
192
|
|
|
191
193
|
def test_msg_size_with_same_tcp_connection
|
|
192
|
-
|
|
194
|
+
port = unused_port(protocol: :tcp)
|
|
195
|
+
d = create_driver([ipv4_config(port), "<transport tcp> \n</transport>"].join("\n"))
|
|
193
196
|
tests = create_test_case
|
|
194
197
|
|
|
195
198
|
d.run(expect_emits: 2) do
|
|
196
|
-
TCPSocket.open('127.0.0.1',
|
|
199
|
+
TCPSocket.open('127.0.0.1', port) do |s|
|
|
197
200
|
tests.each {|test|
|
|
198
201
|
s.send(test['msg'], 0)
|
|
199
202
|
}
|
|
@@ -347,12 +350,13 @@ EOS
|
|
|
347
350
|
|
|
348
351
|
sub_test_case 'octet counting frame' do
|
|
349
352
|
def test_msg_size_with_tcp
|
|
350
|
-
|
|
353
|
+
port = unused_port(protocol: :tcp)
|
|
354
|
+
d = create_driver([ipv4_config(port), "<transport tcp> \n</transport>", 'frame_type octet_count'].join("\n"))
|
|
351
355
|
tests = create_test_case
|
|
352
356
|
|
|
353
357
|
d.run(expect_emits: 2) do
|
|
354
358
|
tests.each {|test|
|
|
355
|
-
TCPSocket.open('127.0.0.1',
|
|
359
|
+
TCPSocket.open('127.0.0.1', port) do |s|
|
|
356
360
|
s.send(test['msg'], 0)
|
|
357
361
|
end
|
|
358
362
|
}
|
|
@@ -363,11 +367,12 @@ EOS
|
|
|
363
367
|
end
|
|
364
368
|
|
|
365
369
|
def test_msg_size_with_same_tcp_connection
|
|
366
|
-
|
|
370
|
+
port = unused_port(protocol: :tcp)
|
|
371
|
+
d = create_driver([ipv4_config(port), "<transport tcp> \n</transport>", 'frame_type octet_count'].join("\n"))
|
|
367
372
|
tests = create_test_case
|
|
368
373
|
|
|
369
374
|
d.run(expect_emits: 2) do
|
|
370
|
-
TCPSocket.open('127.0.0.1',
|
|
375
|
+
TCPSocket.open('127.0.0.1', port) do |s|
|
|
371
376
|
tests.each {|test|
|
|
372
377
|
s.send(test['msg'], 0)
|
|
373
378
|
}
|
|
@@ -469,7 +474,8 @@ EOS
|
|
|
469
474
|
end
|
|
470
475
|
|
|
471
476
|
def test_send_keepalive_packet_is_disabled_by_default
|
|
472
|
-
|
|
477
|
+
port = unused_port(protocol: :tcp)
|
|
478
|
+
d = create_driver(ipv4_config(port) + %[
|
|
473
479
|
<transport tcp>
|
|
474
480
|
</transport>
|
|
475
481
|
protocol tcp
|
|
@@ -479,19 +485,20 @@ EOS
|
|
|
479
485
|
|
|
480
486
|
def test_send_keepalive_packet_can_be_enabled
|
|
481
487
|
addr = "127.0.0.1"
|
|
482
|
-
|
|
488
|
+
port = unused_port(protocol: :tcp)
|
|
489
|
+
d = create_driver(ipv4_config(port) + %[
|
|
483
490
|
<transport tcp>
|
|
484
491
|
</transport>
|
|
485
492
|
send_keepalive_packet true
|
|
486
493
|
])
|
|
487
494
|
assert_true d.instance.send_keepalive_packet
|
|
488
495
|
mock.proxy(d.instance).server_create_connection(
|
|
489
|
-
:in_syslog_tcp_server,
|
|
496
|
+
:in_syslog_tcp_server, port,
|
|
490
497
|
bind: addr,
|
|
491
498
|
resolve_name: nil,
|
|
492
499
|
send_keepalive_packet: true)
|
|
493
500
|
d.run do
|
|
494
|
-
TCPSocket.open(addr,
|
|
501
|
+
TCPSocket.open(addr, port)
|
|
495
502
|
end
|
|
496
503
|
end
|
|
497
504
|
|