fluentd 0.14.2 → 0.14.5
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/ChangeLog +77 -1131
- data/Rakefile +15 -0
- data/appveyor.yml +2 -2
- data/example/in_forward.conf +3 -0
- data/example/in_forward_client.conf +37 -0
- data/example/in_forward_shared_key.conf +15 -0
- data/example/in_forward_users.conf +24 -0
- data/example/multi_filters.conf +61 -0
- data/example/out_forward.conf +13 -13
- data/example/out_forward_client.conf +109 -0
- data/example/out_forward_shared_key.conf +36 -0
- data/example/out_forward_users.conf +65 -0
- data/example/{out_buffered_null.conf → out_null.conf} +10 -6
- data/example/secondary_file.conf +41 -0
- data/fluentd.gemspec +19 -16
- data/lib/fluent/agent.rb +5 -0
- data/lib/fluent/command/debug.rb +4 -4
- data/lib/fluent/compat/handle_tag_and_time_mixin.rb +2 -0
- data/lib/fluent/compat/output.rb +5 -2
- data/lib/fluent/config/configure_proxy.rb +26 -5
- data/lib/fluent/config/error.rb +3 -0
- data/lib/fluent/config/section.rb +15 -0
- data/lib/fluent/event_router.rb +77 -4
- data/lib/fluent/plugin/base.rb +12 -3
- data/lib/fluent/plugin/buffer.rb +5 -1
- data/lib/fluent/plugin/filter.rb +48 -6
- data/lib/fluent/plugin/filter_record_transformer.rb +3 -1
- data/lib/fluent/plugin/filter_stdout.rb +0 -4
- data/lib/fluent/plugin/in_debug_agent.rb +5 -5
- data/lib/fluent/plugin/in_dummy.rb +9 -1
- data/lib/fluent/plugin/in_forward.rb +330 -62
- data/lib/fluent/plugin/in_monitor_agent.rb +31 -77
- data/lib/fluent/plugin/in_tail.rb +76 -92
- data/lib/fluent/plugin/multi_output.rb +4 -0
- data/lib/fluent/plugin/out_forward.rb +328 -222
- data/lib/fluent/plugin/out_null.rb +37 -0
- data/lib/fluent/plugin/out_secondary_file.rb +128 -0
- data/lib/fluent/plugin/out_stdout.rb +38 -2
- data/lib/fluent/plugin/output.rb +29 -6
- data/lib/fluent/plugin/storage_local.rb +16 -0
- data/lib/fluent/plugin_helper/timer.rb +6 -1
- data/lib/fluent/root_agent.rb +4 -1
- data/lib/fluent/supervisor.rb +62 -9
- data/lib/fluent/test/base.rb +3 -0
- data/lib/fluent/test/driver/base.rb +5 -0
- data/lib/fluent/test/formatter_test.rb +2 -0
- data/lib/fluent/test/parser_test.rb +2 -0
- data/lib/fluent/test/startup_shutdown.rb +33 -0
- data/lib/fluent/version.rb +1 -1
- data/lib/fluent/winsvc.rb +1 -2
- data/test/compat/test_calls_super.rb +2 -0
- data/test/config/test_configurable.rb +88 -0
- data/test/config/test_types.rb +7 -3
- data/test/plugin/test_filter.rb +121 -23
- data/test/plugin/test_filter_record_transformer.rb +22 -6
- data/test/plugin/test_in_debug_agent.rb +2 -2
- data/test/plugin/test_in_forward.rb +920 -407
- data/test/plugin/test_in_monitor_agent.rb +333 -0
- data/test/plugin/test_in_tail.rb +686 -595
- data/test/plugin/test_out_forward.rb +150 -207
- data/test/plugin/test_out_null.rb +85 -9
- data/test/plugin/test_out_secondary_file.rb +432 -0
- data/test/plugin/test_out_stdout.rb +143 -45
- data/test/plugin/test_output.rb +53 -0
- data/test/plugin/test_output_as_buffered.rb +13 -0
- data/test/plugin/test_output_as_buffered_overflow.rb +3 -0
- data/test/plugin/test_output_as_buffered_retries.rb +11 -0
- data/test/plugin/test_output_as_buffered_secondary.rb +12 -0
- data/test/plugin/test_output_as_standard.rb +12 -0
- data/test/plugin_helper/test_compat_parameters.rb +2 -0
- data/test/plugin_helper/test_timer.rb +31 -0
- data/test/test_event_router.rb +87 -0
- data/test/test_filter.rb +48 -6
- data/test/test_log.rb +5 -2
- data/test/test_output.rb +41 -1
- data/test/test_plugin_classes.rb +17 -9
- data/test/test_root_agent.rb +188 -0
- metadata +62 -68
- data/lib/fluent/plugin/out_buffered_null.rb +0 -59
- data/lib/fluent/plugin/out_buffered_stdout.rb +0 -70
- data/test/plugin/test_out_buffered_null.rb +0 -79
- data/test/plugin/test_out_buffered_stdout.rb +0 -122
data/Rakefile
CHANGED
|
@@ -7,6 +7,21 @@ require 'rake/clean'
|
|
|
7
7
|
|
|
8
8
|
task test: [:base_test]
|
|
9
9
|
|
|
10
|
+
# 1. update ChangeLog and lib/fluent/version.rb
|
|
11
|
+
# 2. bundle && bundle exec rake build:all
|
|
12
|
+
# 3. release 3 packages built on pkg/ directory
|
|
13
|
+
namespace :build do
|
|
14
|
+
desc 'Build gems for all platforms'
|
|
15
|
+
task :all do
|
|
16
|
+
Bundler.with_clean_env do
|
|
17
|
+
%w[ruby x86-mingw32 x64-mingw32].each do |name|
|
|
18
|
+
ENV['GEM_BUILD_FAKE_PLATFORM'] = name
|
|
19
|
+
Rake::Task["build"].execute
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
10
25
|
desc 'Run test_unit based test'
|
|
11
26
|
Rake::TestTask.new(:base_test) do |t|
|
|
12
27
|
# To run test for only one file (or file path pattern)
|
data/appveyor.yml
CHANGED
|
@@ -28,11 +28,11 @@ environment:
|
|
|
28
28
|
devkit: C:\Ruby23\DevKit
|
|
29
29
|
- ruby_version: "22-x64"
|
|
30
30
|
devkit: C:\Ruby23-x64\DevKit
|
|
31
|
+
- ruby_version: "21-x64"
|
|
32
|
+
devkit: C:\Ruby23-x64\DevKit
|
|
31
33
|
- ruby_version: "22"
|
|
32
34
|
devkit: C:\Ruby23\DevKit
|
|
33
35
|
WIN_RAPID: true
|
|
34
|
-
- ruby_version: "21-x64"
|
|
35
|
-
devkit: C:\Ruby23-x64\DevKit
|
|
36
36
|
- ruby_version: "21"
|
|
37
37
|
devkit: C:\Ruby23\DevKit
|
|
38
38
|
WIN_RAPID: true
|
data/example/in_forward.conf
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<system>
|
|
2
|
+
rpc_endpoint 0.0.0.0:24444
|
|
3
|
+
</system>
|
|
4
|
+
|
|
5
|
+
<source>
|
|
6
|
+
@type forward
|
|
7
|
+
port 24224
|
|
8
|
+
bind 0.0.0.0
|
|
9
|
+
<security>
|
|
10
|
+
self_hostname input.testing.local
|
|
11
|
+
shared_key secure_communication_is_awesome
|
|
12
|
+
user_auth yes
|
|
13
|
+
allow_anonymous_source no
|
|
14
|
+
<user>
|
|
15
|
+
username user1
|
|
16
|
+
password yes_this_is_user1
|
|
17
|
+
</user>
|
|
18
|
+
<user>
|
|
19
|
+
username user2
|
|
20
|
+
password yes_this_is_really_user2
|
|
21
|
+
</user>
|
|
22
|
+
<user>
|
|
23
|
+
username user3
|
|
24
|
+
password noooooo_this_may_not_be_user3
|
|
25
|
+
</user>
|
|
26
|
+
<client>
|
|
27
|
+
# host 127.0.0.1
|
|
28
|
+
network 127.0.0.0/24
|
|
29
|
+
shared_key using_different_key_makes_us_secure
|
|
30
|
+
users user1,user2
|
|
31
|
+
</client>
|
|
32
|
+
</security>
|
|
33
|
+
</source>
|
|
34
|
+
|
|
35
|
+
<match {test,test2,test3,test4}>
|
|
36
|
+
@type stdout
|
|
37
|
+
</match>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<system>
|
|
2
|
+
rpc_endpoint 0.0.0.0:24444
|
|
3
|
+
</system>
|
|
4
|
+
|
|
5
|
+
<source>
|
|
6
|
+
@type forward
|
|
7
|
+
<security>
|
|
8
|
+
self_hostname input.testing.local
|
|
9
|
+
shared_key secure_communication_is_awesome
|
|
10
|
+
user_auth yes
|
|
11
|
+
<user>
|
|
12
|
+
username user1
|
|
13
|
+
password yes_this_is_user1
|
|
14
|
+
</user>
|
|
15
|
+
<user>
|
|
16
|
+
username user2
|
|
17
|
+
password yes_this_is_really_user2
|
|
18
|
+
</user>
|
|
19
|
+
</security>
|
|
20
|
+
</source>
|
|
21
|
+
|
|
22
|
+
<match {test,test2,test3}>
|
|
23
|
+
@type stdout
|
|
24
|
+
</match>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# This example is to measure optimized filter pipeline performance.
|
|
2
|
+
|
|
3
|
+
<source>
|
|
4
|
+
@type dummy
|
|
5
|
+
tag test
|
|
6
|
+
size 1000
|
|
7
|
+
</source>
|
|
8
|
+
|
|
9
|
+
<filter test>
|
|
10
|
+
@type grep
|
|
11
|
+
exclude1 hello .
|
|
12
|
+
</filter>
|
|
13
|
+
|
|
14
|
+
<filter test>
|
|
15
|
+
@type grep
|
|
16
|
+
exclude1 hello .
|
|
17
|
+
</filter>
|
|
18
|
+
|
|
19
|
+
<filter test>
|
|
20
|
+
@type grep
|
|
21
|
+
exclude1 hello .
|
|
22
|
+
</filter>
|
|
23
|
+
|
|
24
|
+
<filter test>
|
|
25
|
+
@type grep
|
|
26
|
+
exclude1 hello .
|
|
27
|
+
</filter>
|
|
28
|
+
|
|
29
|
+
<filter test>
|
|
30
|
+
@type grep
|
|
31
|
+
exclude1 hello .
|
|
32
|
+
</filter>
|
|
33
|
+
|
|
34
|
+
<filter test>
|
|
35
|
+
@type grep
|
|
36
|
+
exclude1 hello .
|
|
37
|
+
</filter>
|
|
38
|
+
|
|
39
|
+
<filter test>
|
|
40
|
+
@type grep
|
|
41
|
+
exclude1 hello .
|
|
42
|
+
</filter>
|
|
43
|
+
|
|
44
|
+
<filter test>
|
|
45
|
+
@type grep
|
|
46
|
+
exclude1 hello .
|
|
47
|
+
</filter>
|
|
48
|
+
|
|
49
|
+
<filter test>
|
|
50
|
+
@type grep
|
|
51
|
+
exclude1 hello .
|
|
52
|
+
</filter>
|
|
53
|
+
|
|
54
|
+
<filter test>
|
|
55
|
+
@type grep
|
|
56
|
+
exclude1 hello .
|
|
57
|
+
</filter>
|
|
58
|
+
|
|
59
|
+
<match test>
|
|
60
|
+
@type buffered_null
|
|
61
|
+
</match>
|
data/example/out_forward.conf
CHANGED
|
@@ -8,22 +8,22 @@
|
|
|
8
8
|
|
|
9
9
|
<server>
|
|
10
10
|
# first server
|
|
11
|
-
host
|
|
11
|
+
host 127.0.0.1
|
|
12
12
|
port 24224
|
|
13
13
|
</server>
|
|
14
|
-
<server>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
</server>
|
|
19
|
-
<server>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</server>
|
|
14
|
+
# <server>
|
|
15
|
+
# # second server
|
|
16
|
+
# host localhost
|
|
17
|
+
# port 24225
|
|
18
|
+
# </server>
|
|
19
|
+
# <server>
|
|
20
|
+
# # second server
|
|
21
|
+
# host localhost
|
|
22
|
+
# port 24226
|
|
23
|
+
# standby
|
|
24
|
+
# </server>
|
|
25
25
|
|
|
26
|
-
flush_interval
|
|
26
|
+
flush_interval 0
|
|
27
27
|
send_timeout 60
|
|
28
28
|
heartbeat_type udp
|
|
29
29
|
heartbeat_interval 1
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<source>
|
|
2
|
+
@type dummy
|
|
3
|
+
tag test
|
|
4
|
+
</source>
|
|
5
|
+
<source>
|
|
6
|
+
@type dummy
|
|
7
|
+
tag test2
|
|
8
|
+
</source>
|
|
9
|
+
<source>
|
|
10
|
+
@type dummy
|
|
11
|
+
tag test3
|
|
12
|
+
</source>
|
|
13
|
+
<source>
|
|
14
|
+
@type dummy
|
|
15
|
+
tag test4
|
|
16
|
+
</source>
|
|
17
|
+
<source>
|
|
18
|
+
@type dummy
|
|
19
|
+
tag test5
|
|
20
|
+
</source>
|
|
21
|
+
|
|
22
|
+
<match test>
|
|
23
|
+
@type forward
|
|
24
|
+
flush_interval 0
|
|
25
|
+
<security>
|
|
26
|
+
self_hostname output.testing.local
|
|
27
|
+
shared_key secure_communication_is_awesome
|
|
28
|
+
</security>
|
|
29
|
+
<server>
|
|
30
|
+
host 127.0.0.1
|
|
31
|
+
port 24224
|
|
32
|
+
username user1
|
|
33
|
+
password yes_this_is_user1
|
|
34
|
+
shared_key using_different_key_makes_us_secure
|
|
35
|
+
</server>
|
|
36
|
+
</match>
|
|
37
|
+
|
|
38
|
+
<match test2>
|
|
39
|
+
@type forward
|
|
40
|
+
flush_interval 0
|
|
41
|
+
<security>
|
|
42
|
+
self_hostname output-alt1.testing.local
|
|
43
|
+
shared_key using_different_key_makes_us_secure
|
|
44
|
+
</security>
|
|
45
|
+
<server>
|
|
46
|
+
host 127.0.0.1
|
|
47
|
+
port 24224
|
|
48
|
+
username user1
|
|
49
|
+
password yes_this_is_user1
|
|
50
|
+
</server>
|
|
51
|
+
<server>
|
|
52
|
+
host 127.0.0.1
|
|
53
|
+
port 24224
|
|
54
|
+
username user2
|
|
55
|
+
password yes_this_is_really_user2
|
|
56
|
+
</server>
|
|
57
|
+
</match>
|
|
58
|
+
|
|
59
|
+
<match test3>
|
|
60
|
+
@type forward
|
|
61
|
+
flush_interval 0
|
|
62
|
+
<security>
|
|
63
|
+
self_hostname output-fail1.testing.local
|
|
64
|
+
# default key: fail
|
|
65
|
+
shared_key secure_communication_is_awesome
|
|
66
|
+
</security>
|
|
67
|
+
<server>
|
|
68
|
+
host 127.0.0.1
|
|
69
|
+
port 24224
|
|
70
|
+
username user1
|
|
71
|
+
password yes_this_is_user1
|
|
72
|
+
# [warn]: Shared key mismatch address="127.0.0.1" hostname="output-fail1.testing.local"
|
|
73
|
+
</server>
|
|
74
|
+
</match>
|
|
75
|
+
|
|
76
|
+
<match test4>
|
|
77
|
+
@type forward
|
|
78
|
+
flush_interval 0
|
|
79
|
+
<security>
|
|
80
|
+
self_hostname output-fail2.testing.local
|
|
81
|
+
shared_key using_different_key_makes_us_secure
|
|
82
|
+
</security>
|
|
83
|
+
<server>
|
|
84
|
+
host 127.0.0.1
|
|
85
|
+
port 24224
|
|
86
|
+
username user3
|
|
87
|
+
# user3 (user denied): fail
|
|
88
|
+
password noooooo_this_may_not_be_user3
|
|
89
|
+
# [warn]: Authentication failed address="127.0.0.1" hostname="output-fail2.testing.local" username="user3"
|
|
90
|
+
</server>
|
|
91
|
+
</match>
|
|
92
|
+
|
|
93
|
+
<match test5>
|
|
94
|
+
@type forward
|
|
95
|
+
flush_interval 0
|
|
96
|
+
<security>
|
|
97
|
+
self_hostname output-fail3.testing.local
|
|
98
|
+
shared_key using_different_key_makes_us_secure
|
|
99
|
+
</security>
|
|
100
|
+
<server>
|
|
101
|
+
# another ip (host rejected): fail
|
|
102
|
+
# This pattern will work only with Ruby 2.3
|
|
103
|
+
host "#{Socket.getifaddrs.select{|i| i.addr.ipv4? }.reject{|i| i.addr.ip_address == '127.0.0.1' }.first.addr.ip_address}"
|
|
104
|
+
port 24224
|
|
105
|
+
username user1
|
|
106
|
+
password yes_this_is_user1
|
|
107
|
+
# [warn]: Anonymous client disallowed address="192.168.1.75" hostname="output-fail3.testing.local"
|
|
108
|
+
</server>
|
|
109
|
+
</match>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<source>
|
|
2
|
+
@type dummy
|
|
3
|
+
tag test
|
|
4
|
+
</source>
|
|
5
|
+
<source>
|
|
6
|
+
@type dummy
|
|
7
|
+
tag test2
|
|
8
|
+
</source>
|
|
9
|
+
|
|
10
|
+
<match test>
|
|
11
|
+
@type forward
|
|
12
|
+
flush_interval 0
|
|
13
|
+
<security>
|
|
14
|
+
self_hostname output.testing.local
|
|
15
|
+
shared_key secure_communication_is_awesome
|
|
16
|
+
</security>
|
|
17
|
+
<server>
|
|
18
|
+
host 127.0.0.1
|
|
19
|
+
port 24224
|
|
20
|
+
</server>
|
|
21
|
+
</match>
|
|
22
|
+
|
|
23
|
+
<match test2>
|
|
24
|
+
@type forward
|
|
25
|
+
flush_interval 0
|
|
26
|
+
<security>
|
|
27
|
+
self_hostname output-fail.testing.local
|
|
28
|
+
shared_key secure_communication_is_not_awesome
|
|
29
|
+
# input plugin shows warning for wrong shared_key
|
|
30
|
+
# 2016-08-08 16:27:00 +0900 [warn]: Shared key mismatch address="127.0.0.1" hostname="output-fail.testing.local"
|
|
31
|
+
</security>
|
|
32
|
+
<server>
|
|
33
|
+
host 127.0.0.1
|
|
34
|
+
port 24224
|
|
35
|
+
</server>
|
|
36
|
+
</match>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<source>
|
|
2
|
+
@type dummy
|
|
3
|
+
tag test
|
|
4
|
+
</source>
|
|
5
|
+
<source>
|
|
6
|
+
@type dummy
|
|
7
|
+
tag test2
|
|
8
|
+
</source>
|
|
9
|
+
<source>
|
|
10
|
+
@type dummy
|
|
11
|
+
tag test3
|
|
12
|
+
</source>
|
|
13
|
+
|
|
14
|
+
<match test>
|
|
15
|
+
@type forward
|
|
16
|
+
flush_interval 0
|
|
17
|
+
<security>
|
|
18
|
+
self_hostname output.testing.local
|
|
19
|
+
shared_key secure_communication_is_awesome
|
|
20
|
+
</security>
|
|
21
|
+
<server>
|
|
22
|
+
host 127.0.0.1
|
|
23
|
+
port 24224
|
|
24
|
+
username user1
|
|
25
|
+
password yes_this_is_user1
|
|
26
|
+
</server>
|
|
27
|
+
</match>
|
|
28
|
+
|
|
29
|
+
<match test2>
|
|
30
|
+
@type forward
|
|
31
|
+
flush_interval 0
|
|
32
|
+
<security>
|
|
33
|
+
self_hostname output-alt1.testing.local
|
|
34
|
+
shared_key secure_communication_is_awesome
|
|
35
|
+
</security>
|
|
36
|
+
<server>
|
|
37
|
+
host 127.0.0.1
|
|
38
|
+
port 24224
|
|
39
|
+
username user1
|
|
40
|
+
password yes_this_is_user1
|
|
41
|
+
</server>
|
|
42
|
+
<server>
|
|
43
|
+
host 127.0.0.1
|
|
44
|
+
port 24224
|
|
45
|
+
username user2
|
|
46
|
+
password yes_this_is_really_user2
|
|
47
|
+
</server>
|
|
48
|
+
</match>
|
|
49
|
+
|
|
50
|
+
<match test3>
|
|
51
|
+
@type forward
|
|
52
|
+
flush_interval 0
|
|
53
|
+
<security>
|
|
54
|
+
self_hostname output-fail.testing.local
|
|
55
|
+
shared_key secure_communication_is_awesome
|
|
56
|
+
</security>
|
|
57
|
+
<server>
|
|
58
|
+
host 127.0.0.1
|
|
59
|
+
port 24224
|
|
60
|
+
username user3
|
|
61
|
+
password no_there_are_not_such_user
|
|
62
|
+
# input plugin warns authentication erro:
|
|
63
|
+
# [warn]: Authentication failed address="127.0.0.1" hostname="output-fail.testing.local" username="user3"
|
|
64
|
+
</server>
|
|
65
|
+
</match>
|
|
@@ -13,16 +13,20 @@
|
|
|
13
13
|
</source>
|
|
14
14
|
|
|
15
15
|
<match dummy.**>
|
|
16
|
-
@type
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
@type null
|
|
17
|
+
<buffer>
|
|
18
|
+
flush_interval 60s
|
|
19
|
+
chunk_limit_size 1k
|
|
20
|
+
total_limit_size 4k
|
|
21
|
+
</buffer>
|
|
21
22
|
</match>
|
|
22
23
|
|
|
23
24
|
<label error_log>
|
|
24
25
|
<match **>
|
|
25
|
-
@type stdout
|
|
26
|
+
@type stdout
|
|
27
|
+
# <buffer>
|
|
28
|
+
# flush_interval 1s
|
|
29
|
+
# </buffer>
|
|
26
30
|
</match>
|
|
27
31
|
</label>
|
|
28
32
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<system>
|
|
2
|
+
rpc_endpoint 0.0.0.0:24444
|
|
3
|
+
</system>
|
|
4
|
+
|
|
5
|
+
<source>
|
|
6
|
+
@type dummy
|
|
7
|
+
tag test
|
|
8
|
+
</source>
|
|
9
|
+
|
|
10
|
+
<source>
|
|
11
|
+
@type forward
|
|
12
|
+
@label @raw
|
|
13
|
+
</source>
|
|
14
|
+
|
|
15
|
+
<label @raw>
|
|
16
|
+
<match>
|
|
17
|
+
@type stdout
|
|
18
|
+
</match>
|
|
19
|
+
</label>
|
|
20
|
+
|
|
21
|
+
<match test>
|
|
22
|
+
@type forward
|
|
23
|
+
|
|
24
|
+
<buffer time,tag,message>
|
|
25
|
+
type memory
|
|
26
|
+
timekey 2s
|
|
27
|
+
timekey_wait 1s
|
|
28
|
+
flush_interval 1s
|
|
29
|
+
</buffer>
|
|
30
|
+
|
|
31
|
+
<server>
|
|
32
|
+
host 0.0.0.0
|
|
33
|
+
port 24224
|
|
34
|
+
</server>
|
|
35
|
+
|
|
36
|
+
<secondary>
|
|
37
|
+
type secondary_file
|
|
38
|
+
directory log/secondary/
|
|
39
|
+
basename ${tag}_%Y%m%d%L_${message}
|
|
40
|
+
</secondary>
|
|
41
|
+
</match>
|
data/fluentd.gemspec
CHANGED
|
@@ -19,30 +19,33 @@ Gem::Specification.new do |gem|
|
|
|
19
19
|
|
|
20
20
|
gem.required_ruby_version = '>= 2.1'
|
|
21
21
|
|
|
22
|
-
gem.add_runtime_dependency("msgpack", [">= 0.7.0"])
|
|
23
|
-
gem.add_runtime_dependency("json", [">= 1.4.3"])
|
|
22
|
+
gem.add_runtime_dependency("msgpack", [">= 0.7.0", "< 2.0.0"])
|
|
24
23
|
gem.add_runtime_dependency("yajl-ruby", ["~> 1.0"])
|
|
25
|
-
gem.add_runtime_dependency("cool.io", ["
|
|
26
|
-
gem.add_runtime_dependency("serverengine", ["
|
|
24
|
+
gem.add_runtime_dependency("cool.io", ["~> 1.4.5"])
|
|
25
|
+
gem.add_runtime_dependency("serverengine", ["~> 2.0"])
|
|
27
26
|
gem.add_runtime_dependency("http_parser.rb", [">= 0.5.1", "< 0.7.0"])
|
|
28
27
|
gem.add_runtime_dependency("sigdump", ["~> 0.2.2"])
|
|
29
|
-
gem.add_runtime_dependency("tzinfo", ["
|
|
30
|
-
gem.add_runtime_dependency("tzinfo-data", ["
|
|
31
|
-
|
|
28
|
+
gem.add_runtime_dependency("tzinfo", ["~> 1.0"])
|
|
29
|
+
gem.add_runtime_dependency("tzinfo-data", ["~> 1.0"])
|
|
30
|
+
gem.add_runtime_dependency("strptime", ["~> 0.1.7"])
|
|
31
|
+
|
|
32
|
+
# build gem for a certain platform. see also Rakefile
|
|
33
|
+
fake_platform = ENV['GEM_BUILD_FAKE_PLATFORM'].to_s
|
|
34
|
+
gem.platform = fake_platform unless fake_platform.empty?
|
|
35
|
+
if /mswin|mingw/ =~ fake_platform || (/mswin|mingw/ =~ RUBY_PLATFORM && fake_platform.empty?)
|
|
32
36
|
gem.add_runtime_dependency("win32-service", ["~> 0.8.3"])
|
|
33
37
|
gem.add_runtime_dependency("win32-ipc", ["~> 0.6.1"])
|
|
34
38
|
gem.add_runtime_dependency("win32-event", ["~> 0.6.1"])
|
|
35
39
|
gem.add_runtime_dependency("windows-pr", ["~> 1.2.5"])
|
|
36
40
|
end
|
|
37
|
-
gem.add_runtime_dependency("strptime", [">= 0.1.7"])
|
|
38
41
|
|
|
39
|
-
gem.add_development_dependency("rake", ["
|
|
40
|
-
gem.add_development_dependency("flexmock", ["~> 2.0
|
|
41
|
-
gem.add_development_dependency("parallel_tests", ["
|
|
42
|
-
gem.add_development_dependency("simplecov", ["~> 0.
|
|
43
|
-
gem.add_development_dependency("rr", ["
|
|
44
|
-
gem.add_development_dependency("timecop", ["
|
|
45
|
-
gem.add_development_dependency("test-unit", ["~> 3.
|
|
46
|
-
gem.add_development_dependency("test-unit-rr", ["~> 1.0
|
|
42
|
+
gem.add_development_dependency("rake", ["~> 11.0"])
|
|
43
|
+
gem.add_development_dependency("flexmock", ["~> 2.0"])
|
|
44
|
+
gem.add_development_dependency("parallel_tests", ["~> 0.15.3"])
|
|
45
|
+
gem.add_development_dependency("simplecov", ["~> 0.7"])
|
|
46
|
+
gem.add_development_dependency("rr", ["~> 1.0"])
|
|
47
|
+
gem.add_development_dependency("timecop", ["~> 0.3"])
|
|
48
|
+
gem.add_development_dependency("test-unit", ["~> 3.2"])
|
|
49
|
+
gem.add_development_dependency("test-unit-rr", ["~> 1.0"])
|
|
47
50
|
gem.add_development_dependency("oj", ["~> 2.14"])
|
|
48
51
|
end
|
data/lib/fluent/agent.rb
CHANGED
|
@@ -63,6 +63,7 @@ module Fluent
|
|
|
63
63
|
conf.elements('filter', 'match').each { |e|
|
|
64
64
|
pattern = e.arg.empty? ? '**' : e.arg
|
|
65
65
|
type = e['@type']
|
|
66
|
+
raise ConfigError, "Missing '@type' parameter on <#{e.name}> directive" unless type
|
|
66
67
|
if e.name == 'filter'
|
|
67
68
|
add_filter(type, pattern, e)
|
|
68
69
|
else
|
|
@@ -134,6 +135,10 @@ module Fluent
|
|
|
134
135
|
output.router = @event_router if output.respond_to?(:router=)
|
|
135
136
|
output.configure(conf)
|
|
136
137
|
@outputs << output
|
|
138
|
+
if output.respond_to?(:outputs) && (output.respond_to?(:multi_output?) && output.multi_output? || output.is_a?(Fluent::MultiOutput))
|
|
139
|
+
# TODO: ruby 2.3 or later: replace `output.respond_to?(:multi_output?) && output.multi_output?` with output&.multi_output?
|
|
140
|
+
@outputs.push(*output.outputs)
|
|
141
|
+
end
|
|
137
142
|
@event_router.add_rule(pattern, output)
|
|
138
143
|
|
|
139
144
|
output
|
data/lib/fluent/command/debug.rb
CHANGED
|
@@ -63,6 +63,7 @@ end
|
|
|
63
63
|
require 'fluent/log'
|
|
64
64
|
require 'fluent/engine'
|
|
65
65
|
require 'fluent/system_config'
|
|
66
|
+
require 'serverengine'
|
|
66
67
|
|
|
67
68
|
include Fluent::SystemConfig::Mixin
|
|
68
69
|
|
|
@@ -90,13 +91,12 @@ include Fluent
|
|
|
90
91
|
|
|
91
92
|
puts "Connected to #{uri}."
|
|
92
93
|
puts "Usage:"
|
|
93
|
-
puts " Engine.match('some.tag').output : get an output plugin instance"
|
|
94
|
-
puts " Engine.sources[i] : get input plugin instances"
|
|
95
|
-
puts " Plugin.load_plugin(type,name) : load plugin class (use this if you get DRb::DRbUnknown)"
|
|
94
|
+
puts " Fluent::Engine.match('some.tag').output : get an output plugin instance"
|
|
95
|
+
puts " Fluent::Engine.sources[i] : get input plugin instances"
|
|
96
|
+
puts " Fluent::Plugin.load_plugin(type,name) : load plugin class (use this if you get DRb::DRbUnknown)"
|
|
96
97
|
puts ""
|
|
97
98
|
|
|
98
99
|
Encoding.default_internal = nil if Encoding.respond_to?(:default_internal)
|
|
99
100
|
|
|
100
101
|
require 'irb'
|
|
101
102
|
IRB.start
|
|
102
|
-
|
data/lib/fluent/compat/output.rb
CHANGED
|
@@ -19,8 +19,10 @@ require 'fluent/plugin/output'
|
|
|
19
19
|
require 'fluent/plugin/bare_output'
|
|
20
20
|
require 'fluent/compat/call_super_mixin'
|
|
21
21
|
require 'fluent/compat/formatter_utils'
|
|
22
|
+
require 'fluent/compat/handle_tag_and_time_mixin'
|
|
22
23
|
require 'fluent/compat/parser_utils'
|
|
23
24
|
require 'fluent/compat/propagate_default'
|
|
25
|
+
require 'fluent/compat/record_filter_mixin'
|
|
24
26
|
require 'fluent/compat/output_chain'
|
|
25
27
|
require 'fluent/timezone'
|
|
26
28
|
require 'fluent/mixin'
|
|
@@ -265,7 +267,7 @@ module Fluent
|
|
|
265
267
|
conf.elements << Fluent::Config::Element.new('buffer', '', buf_params, [])
|
|
266
268
|
end
|
|
267
269
|
|
|
268
|
-
@includes_record_filter = self.class.ancestors.include?(Fluent::
|
|
270
|
+
@includes_record_filter = self.class.ancestors.include?(Fluent::Compat::RecordFilterMixin)
|
|
269
271
|
|
|
270
272
|
methods_of_plugin = self.class.instance_methods(false)
|
|
271
273
|
@overrides_emit = methods_of_plugin.include?(:emit)
|
|
@@ -361,11 +363,12 @@ module Fluent
|
|
|
361
363
|
end
|
|
362
364
|
|
|
363
365
|
meta = metadata(nil, nil, nil)
|
|
366
|
+
size = es.size
|
|
364
367
|
data = es.map{|time,record| format(tag, time, record) }
|
|
365
368
|
write_guard do
|
|
366
369
|
@buffer.write({meta => data}, enqueue: enqueue)
|
|
367
370
|
end
|
|
368
|
-
@counters_monitor.synchronize{ @emit_records +=
|
|
371
|
+
@counters_monitor.synchronize{ @emit_records += size }
|
|
369
372
|
[meta]
|
|
370
373
|
end
|
|
371
374
|
|