fluentd 0.14.0 → 0.14.1
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/example/copy_roundrobin.conf +39 -0
- data/example/filter_stdout.conf +5 -5
- data/example/in_forward.conf +2 -2
- data/example/in_http.conf +2 -2
- data/example/in_syslog.conf +2 -2
- data/example/in_tail.conf +2 -2
- data/example/in_tcp.conf +2 -2
- data/example/in_udp.conf +2 -2
- data/example/out_buffered_null.conf +32 -0
- data/example/out_copy.conf +4 -4
- data/example/out_file.conf +2 -2
- data/example/out_forward.conf +2 -2
- data/example/v0_12_filter.conf +8 -8
- data/fluentd.gemspec +1 -1
- data/lib/fluent/command/fluentd.rb +6 -1
- data/lib/fluent/compat/handle_tag_name_mixin.rb +53 -0
- data/lib/fluent/compat/input.rb +1 -0
- data/lib/fluent/compat/output.rb +1 -0
- data/lib/fluent/compat/record_filter_mixin.rb +34 -0
- data/lib/fluent/compat/set_tag_key_mixin.rb +50 -0
- data/lib/fluent/compat/set_time_key_mixin.rb +69 -0
- data/lib/fluent/compat/type_converter.rb +90 -0
- data/lib/fluent/config/configure_proxy.rb +24 -4
- data/lib/fluent/config/dsl.rb +18 -1
- data/lib/fluent/config/v1_parser.rb +3 -2
- data/lib/fluent/configurable.rb +1 -1
- data/lib/fluent/event.rb +37 -9
- data/lib/fluent/mixin.rb +12 -286
- data/lib/fluent/plugin/buffer.rb +2 -2
- data/lib/fluent/plugin/in_dummy.rb +5 -1
- data/lib/fluent/plugin/in_gc_stat.rb +7 -37
- data/lib/fluent/plugin/in_http.rb +2 -0
- data/lib/fluent/plugin/{in_stream.rb → in_unix.rb} +0 -0
- data/lib/fluent/plugin/out_buffered_stdout.rb +60 -0
- data/lib/fluent/plugin/out_copy.rb +8 -51
- data/lib/fluent/plugin/out_null.rb +5 -5
- data/lib/fluent/plugin/out_relabel.rb +5 -5
- data/lib/fluent/plugin/out_roundrobin.rb +13 -40
- data/lib/fluent/plugin/output.rb +9 -0
- data/lib/fluent/plugin_helper.rb +2 -0
- data/lib/fluent/plugin_helper/formatter.rb +138 -0
- data/lib/fluent/plugin_helper/inject.rb +112 -0
- data/lib/fluent/plugin_helper/parser.rb +138 -0
- data/lib/fluent/plugin_helper/storage.rb +64 -50
- data/lib/fluent/process.rb +6 -1
- data/lib/fluent/registry.rb +1 -1
- data/lib/fluent/supervisor.rb +20 -2
- data/lib/fluent/test.rb +30 -5
- data/lib/fluent/test/base.rb +2 -66
- data/lib/fluent/test/driver/base.rb +3 -0
- data/lib/fluent/test/driver/base_owned.rb +106 -0
- data/lib/fluent/test/driver/formatter.rb +30 -0
- data/lib/fluent/test/driver/multi_output.rb +52 -0
- data/lib/fluent/test/driver/owner.rb +32 -0
- data/lib/fluent/test/driver/parser.rb +30 -0
- data/lib/fluent/test/helpers.rb +54 -0
- data/lib/fluent/test/log.rb +73 -0
- data/lib/fluent/time.rb +71 -0
- data/lib/fluent/version.rb +1 -1
- data/test/compat/test_parser.rb +82 -0
- data/test/config/test_configure_proxy.rb +15 -0
- data/test/config/test_dsl.rb +180 -2
- data/test/helper.rb +2 -24
- data/test/plugin/test_in_gc_stat.rb +6 -6
- data/test/plugin/test_in_http.rb +49 -32
- data/test/plugin/{test_in_stream.rb → test_in_unix.rb} +1 -1
- data/test/plugin/test_out_buffered_stdout.rb +108 -0
- data/test/plugin/test_out_copy.rb +88 -127
- data/test/plugin/test_out_null.rb +29 -0
- data/test/plugin/test_out_relabel.rb +28 -0
- data/test/plugin/test_out_roundrobin.rb +35 -29
- data/test/plugin/test_out_stdout.rb +4 -4
- data/test/plugin/test_output_as_buffered.rb +51 -0
- data/test/plugin/test_output_as_buffered_secondary.rb +13 -0
- data/test/plugin/test_parser_apache.rb +38 -0
- data/test/plugin/test_parser_apache2.rb +38 -0
- data/test/plugin/test_parser_apache_error.rb +40 -0
- data/test/plugin/test_parser_base.rb +32 -0
- data/test/plugin/test_parser_csv.rb +94 -0
- data/test/plugin/test_parser_json.rb +107 -0
- data/test/plugin/test_parser_labeled_tsv.rb +129 -0
- data/test/plugin/test_parser_multiline.rb +100 -0
- data/test/plugin/test_parser_nginx.rb +42 -0
- data/test/plugin/test_parser_none.rb +53 -0
- data/test/plugin/test_parser_regexp.rb +110 -0
- data/test/plugin/test_parser_syslog.rb +66 -0
- data/test/plugin/test_parser_time.rb +46 -0
- data/test/plugin/test_parser_tsv.rb +125 -0
- data/test/plugin_helper/test_child_process.rb +11 -2
- data/test/plugin_helper/test_formatter.rb +212 -0
- data/test/plugin_helper/test_inject.rb +388 -0
- data/test/plugin_helper/test_parser.rb +223 -0
- data/test/plugin_helper/test_retry_state.rb +40 -40
- data/test/plugin_helper/test_storage.rb +77 -10
- data/test/scripts/fluent/plugin/out_test.rb +22 -17
- data/test/scripts/fluent/plugin/out_test2.rb +80 -0
- data/test/test_event.rb +57 -0
- data/test/test_formatter.rb +0 -178
- data/test/test_output.rb +2 -152
- data/test/test_root_agent.rb +3 -2
- data/test/test_supervisor.rb +93 -26
- data/test/test_time_formatter.rb +186 -0
- metadata +69 -7
- data/test/test_parser.rb +0 -1087
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3eae91c70d2df47e3cd6aeb7b1e80d44fd8ee41b
|
4
|
+
data.tar.gz: 926661743f2177e7d116c1c7238d802b57fee63d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3584a4e41dc1188a43c0f5b75ea8505662bae178bdc796dd3a2cc8d28395000c18cb9b13c55cc34c113bf5d704c571634ba0ea1709325cc255e88da2a0150e74
|
7
|
+
data.tar.gz: 2f3836aea63fbaa48d761f2bce898f2925e130228c0c1b40e7115f2ccb0ce424aa7cd6200c0381b279f4358f3eef2e3d90e0f50ee0114441aaecc15250f1e2bd
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<source>
|
2
|
+
@type dummy
|
3
|
+
@label @test
|
4
|
+
tag test.copy
|
5
|
+
auto_increment_key id
|
6
|
+
</source>
|
7
|
+
|
8
|
+
<source>
|
9
|
+
@type dummy
|
10
|
+
@label @test
|
11
|
+
tag test.rr
|
12
|
+
auto_increment_key id
|
13
|
+
</source>
|
14
|
+
|
15
|
+
<label @test>
|
16
|
+
<match test.copy>
|
17
|
+
@type copy
|
18
|
+
<store>
|
19
|
+
@type stdout
|
20
|
+
output_type json
|
21
|
+
</store>
|
22
|
+
<store>
|
23
|
+
@type stdout
|
24
|
+
output_type ltsv
|
25
|
+
</store>
|
26
|
+
</match>
|
27
|
+
|
28
|
+
<match test.rr>
|
29
|
+
@type roundrobin
|
30
|
+
<store>
|
31
|
+
@type stdout
|
32
|
+
output_type json
|
33
|
+
</store>
|
34
|
+
<store>
|
35
|
+
@type stdout
|
36
|
+
output_type ltsv
|
37
|
+
</store>
|
38
|
+
</match>
|
39
|
+
</label>
|
data/example/filter_stdout.conf
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
<source>
|
2
|
-
type dummy
|
2
|
+
@type dummy
|
3
3
|
tag dummy
|
4
4
|
</source>
|
5
5
|
|
6
6
|
<filter **>
|
7
|
-
type stdout
|
7
|
+
@type stdout
|
8
8
|
</filter>
|
9
9
|
|
10
10
|
<filter **>
|
11
|
-
type stdout
|
11
|
+
@type stdout
|
12
12
|
output_type hash
|
13
13
|
</filter>
|
14
14
|
|
15
15
|
<filter **>
|
16
|
-
type stdout
|
16
|
+
@type stdout
|
17
17
|
format ltsv
|
18
18
|
</filter>
|
19
19
|
|
20
20
|
<match **>
|
21
|
-
type null
|
21
|
+
@type null
|
22
22
|
</match>
|
data/example/in_forward.conf
CHANGED
data/example/in_http.conf
CHANGED
data/example/in_syslog.conf
CHANGED
data/example/in_tail.conf
CHANGED
data/example/in_tcp.conf
CHANGED
data/example/in_udp.conf
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
#
|
2
|
+
# bundle exec bin/fluentd -c example/out_buffered_null.conf
|
3
|
+
# (+ --emit-error-log-interval 10)
|
4
|
+
<source>
|
5
|
+
@type dummy
|
6
|
+
tag dummy
|
7
|
+
rate 500000000
|
8
|
+
dummy [
|
9
|
+
{"message": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},
|
10
|
+
{"message": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"},
|
11
|
+
{"message": "ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"}
|
12
|
+
]
|
13
|
+
</source>
|
14
|
+
|
15
|
+
<match dummy.**>
|
16
|
+
@type buffered_null
|
17
|
+
try_flush_interval 60
|
18
|
+
flush_interval 60
|
19
|
+
buffer_chunk_limit 1k
|
20
|
+
buffer_queue_limit 2
|
21
|
+
</match>
|
22
|
+
|
23
|
+
<label error_log>
|
24
|
+
<match **>
|
25
|
+
@type stdout # or buffered_stdout
|
26
|
+
</match>
|
27
|
+
</label>
|
28
|
+
|
29
|
+
<match fluent.**>
|
30
|
+
@type relabel
|
31
|
+
@label error_log
|
32
|
+
</match>
|
data/example/out_copy.conf
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
<source>
|
2
|
-
type forward
|
2
|
+
@type forward
|
3
3
|
</source>
|
4
4
|
|
5
5
|
<match test>
|
6
|
-
type copy
|
6
|
+
@type copy
|
7
7
|
deep_copy false
|
8
8
|
<store>
|
9
|
-
type stdout
|
9
|
+
@type stdout
|
10
10
|
</store>
|
11
11
|
<store>
|
12
|
-
type file
|
12
|
+
@type file
|
13
13
|
path /var/log/fluentd/out_file_test
|
14
14
|
format json
|
15
15
|
buffer_type memory
|
data/example/out_file.conf
CHANGED
data/example/out_forward.conf
CHANGED
data/example/v0_12_filter.conf
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
# $ echo '{"message":"hello world"}' | fluent-cat foo
|
10
10
|
|
11
11
|
<source>
|
12
|
-
type forward
|
12
|
+
@type forward
|
13
13
|
port 24224
|
14
14
|
</source>
|
15
15
|
|
@@ -21,13 +21,13 @@
|
|
21
21
|
# - {"messag22":"keep this please"} is filtered out.
|
22
22
|
|
23
23
|
<filter foo>
|
24
|
-
type grep
|
24
|
+
@type grep
|
25
25
|
regexp1 message keep this
|
26
26
|
</filter>
|
27
27
|
|
28
28
|
# Matches the events that was kept by the above filter
|
29
29
|
<match foo>
|
30
|
-
type stdout
|
30
|
+
@type stdout
|
31
31
|
</match>
|
32
32
|
|
33
33
|
# For all events with the tag "bar", add the machine's hostname with
|
@@ -35,7 +35,7 @@
|
|
35
35
|
# at 123.4.2.4:24224.
|
36
36
|
|
37
37
|
<filter bar>
|
38
|
-
type record_transformer
|
38
|
+
@type record_transformer
|
39
39
|
<record>
|
40
40
|
hostname ${hostname}
|
41
41
|
</record>
|
@@ -44,7 +44,7 @@
|
|
44
44
|
# By the time it is getting matched here, the event has
|
45
45
|
# the "hostname" field.
|
46
46
|
<match bar>
|
47
|
-
type forward
|
47
|
+
@type forward
|
48
48
|
<server>
|
49
49
|
host 123.4.2.4
|
50
50
|
port 24225
|
@@ -61,12 +61,12 @@
|
|
61
61
|
# - {"last_name":"FURUHASHI"} throws an error because it has no field called "name"
|
62
62
|
|
63
63
|
<filter foo.bar>
|
64
|
-
type grep
|
64
|
+
@type grep
|
65
65
|
exclude1 hello .
|
66
66
|
</filter>
|
67
67
|
|
68
68
|
<filter foo.bar>
|
69
|
-
type record_transformer
|
69
|
+
@type record_transformer
|
70
70
|
enable_ruby true
|
71
71
|
<record>
|
72
72
|
name ${name.downcase}
|
@@ -74,5 +74,5 @@
|
|
74
74
|
</filter>
|
75
75
|
|
76
76
|
<match foo.bar>
|
77
|
-
type stdout
|
77
|
+
@type stdout
|
78
78
|
</match>
|
data/fluentd.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |gem|
|
|
32
32
|
gem.add_runtime_dependency("win32-service", ["~> 0.8.3"])
|
33
33
|
gem.add_runtime_dependency("win32-ipc", ["~> 0.6.1"])
|
34
34
|
gem.add_runtime_dependency("win32-event", ["~> 0.6.1"])
|
35
|
-
gem.add_runtime_dependency("windows-pr", ["~> 1.2.
|
35
|
+
gem.add_runtime_dependency("windows-pr", ["~> 1.2.5"])
|
36
36
|
end
|
37
37
|
gem.add_runtime_dependency("strptime", [">= 0.1.7"])
|
38
38
|
|
@@ -60,10 +60,15 @@ op.on('-d', '--daemon PIDFILE', "daemonize fluent process") {|s|
|
|
60
60
|
opts[:daemonize] = s
|
61
61
|
}
|
62
62
|
|
63
|
-
op.on('--
|
63
|
+
op.on('--under-supervisor', "run fluent worker under supervisor (this option is NOT for users)") {
|
64
64
|
opts[:supervise] = false
|
65
65
|
}
|
66
66
|
|
67
|
+
op.on('--no-supervisor', "run fluent worker without supervisor") {
|
68
|
+
opts[:supervise] = false
|
69
|
+
opts[:standalone_worker] = true
|
70
|
+
}
|
71
|
+
|
67
72
|
op.on('--user USER', "change user") {|s|
|
68
73
|
opts[:chuser] = s
|
69
74
|
}
|
@@ -0,0 +1,53 @@
|
|
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/compat/record_filter_mixin'
|
18
|
+
|
19
|
+
module Fluent
|
20
|
+
module Compat
|
21
|
+
module HandleTagNameMixin
|
22
|
+
include RecordFilterMixin
|
23
|
+
|
24
|
+
attr_accessor :remove_tag_prefix, :remove_tag_suffix, :add_tag_prefix, :add_tag_suffix
|
25
|
+
def configure(conf)
|
26
|
+
super
|
27
|
+
|
28
|
+
@remove_tag_prefix = if conf.has_key?('remove_tag_prefix')
|
29
|
+
Regexp.new('^' + Regexp.escape(conf['remove_tag_prefix']))
|
30
|
+
else
|
31
|
+
nil
|
32
|
+
end
|
33
|
+
|
34
|
+
@remove_tag_suffix = if conf.has_key?('remove_tag_suffix')
|
35
|
+
Regexp.new(Regexp.escape(conf['remove_tag_suffix']) + '$')
|
36
|
+
else
|
37
|
+
nil
|
38
|
+
end
|
39
|
+
|
40
|
+
@add_tag_prefix = conf['add_tag_prefix']
|
41
|
+
@add_tag_suffix = conf['add_tag_suffix']
|
42
|
+
end
|
43
|
+
|
44
|
+
def filter_record(tag, time, record)
|
45
|
+
tag.sub!(@remove_tag_prefix, '') if @remove_tag_prefix
|
46
|
+
tag.sub!(@remove_tag_suffix, '') if @remove_tag_suffix
|
47
|
+
tag.insert(0, @add_tag_prefix) if @add_tag_prefix
|
48
|
+
tag << @add_tag_suffix if @add_tag_suffix
|
49
|
+
super(tag, time, record)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
data/lib/fluent/compat/input.rb
CHANGED
data/lib/fluent/compat/output.rb
CHANGED
@@ -0,0 +1,34 @@
|
|
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 Compat
|
19
|
+
module RecordFilterMixin
|
20
|
+
def filter_record(tag, time, record)
|
21
|
+
end
|
22
|
+
|
23
|
+
def format_stream(tag, es)
|
24
|
+
out = ''
|
25
|
+
es.each {|time,record|
|
26
|
+
tag_temp = tag.dup
|
27
|
+
filter_record(tag_temp, time, record)
|
28
|
+
out << format(tag_temp, time, record)
|
29
|
+
}
|
30
|
+
out
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,50 @@
|
|
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/config/error'
|
18
|
+
require 'fluent/config/types'
|
19
|
+
require 'fluent/compat/record_filter_mixin'
|
20
|
+
|
21
|
+
module Fluent
|
22
|
+
module Compat
|
23
|
+
module SetTagKeyMixin
|
24
|
+
include RecordFilterMixin
|
25
|
+
|
26
|
+
attr_accessor :include_tag_key, :tag_key
|
27
|
+
|
28
|
+
def configure(conf)
|
29
|
+
@include_tag_key = false
|
30
|
+
|
31
|
+
super
|
32
|
+
|
33
|
+
if s = conf['include_tag_key']
|
34
|
+
include_tag_key = Fluent::Config.bool_value(s)
|
35
|
+
raise Fluent::ConfigError, "Invalid boolean expression '#{s}' for include_tag_key parameter" if include_tag_key.nil?
|
36
|
+
|
37
|
+
@include_tag_key = include_tag_key
|
38
|
+
end
|
39
|
+
|
40
|
+
@tag_key = conf['tag_key'] || 'tag' if @include_tag_key
|
41
|
+
end
|
42
|
+
|
43
|
+
def filter_record(tag, time, record)
|
44
|
+
super
|
45
|
+
|
46
|
+
record[@tag_key] = tag if @include_tag_key
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|