fluentd 1.13.0 → 1.14.0.rc
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/bug_report.yaml +69 -0
- data/.github/ISSUE_TEMPLATE/feature_request.yaml +38 -0
- data/.github/workflows/linux-test.yaml +1 -1
- data/.github/workflows/windows-test.yaml +1 -1
- data/.gitlab-ci.yml +0 -22
- data/CHANGELOG.md +87 -0
- data/README.md +2 -2
- data/example/v0_12_filter.conf +2 -2
- data/fluentd.gemspec +1 -1
- data/lib/fluent/command/fluentd.rb +8 -0
- data/lib/fluent/command/plugin_generator.rb +15 -5
- data/lib/fluent/compat/output.rb +9 -6
- data/lib/fluent/config.rb +1 -1
- data/lib/fluent/config/section.rb +5 -0
- data/lib/fluent/config/types.rb +15 -0
- data/lib/fluent/config/v1_parser.rb +3 -2
- data/lib/fluent/env.rb +2 -1
- data/lib/fluent/event_router.rb +28 -1
- data/lib/fluent/oj_options.rb +62 -0
- data/lib/fluent/plugin.rb +10 -1
- data/lib/fluent/plugin/bare_output.rb +49 -8
- data/lib/fluent/plugin/buffer.rb +84 -22
- data/lib/fluent/plugin/file_wrapper.rb +22 -0
- data/lib/fluent/plugin/filter.rb +35 -1
- data/lib/fluent/plugin/formatter.rb +1 -0
- data/lib/fluent/plugin/formatter_json.rb +9 -7
- data/lib/fluent/plugin/in_monitor_agent.rb +4 -2
- data/lib/fluent/plugin/in_syslog.rb +13 -1
- data/lib/fluent/plugin/in_tail.rb +45 -4
- data/lib/fluent/plugin/in_tail/position_file.rb +20 -18
- data/lib/fluent/plugin/input.rb +39 -1
- data/lib/fluent/plugin/metrics.rb +119 -0
- data/lib/fluent/plugin/metrics_local.rb +96 -0
- data/lib/fluent/plugin/multi_output.rb +43 -6
- data/lib/fluent/plugin/out_forward.rb +1 -3
- data/lib/fluent/plugin/output.rb +74 -33
- data/lib/fluent/plugin/parser_json.rb +2 -3
- data/lib/fluent/plugin/service_discovery.rb +0 -15
- data/lib/fluent/plugin_helper.rb +1 -0
- data/lib/fluent/plugin_helper/event_emitter.rb +8 -1
- data/lib/fluent/plugin_helper/http_server/router.rb +1 -1
- data/lib/fluent/plugin_helper/metrics.rb +129 -0
- data/lib/fluent/plugin_helper/server.rb +4 -2
- data/lib/fluent/root_agent.rb +6 -0
- data/lib/fluent/supervisor.rb +2 -0
- data/lib/fluent/system_config.rb +9 -1
- data/lib/fluent/test/driver/storage.rb +30 -0
- data/lib/fluent/version.rb +1 -1
- data/templates/new_gem/lib/fluent/plugin/storage.rb.erb +40 -0
- data/templates/new_gem/test/plugin/test_storage.rb.erb +18 -0
- data/test/command/test_cat.rb +11 -8
- data/test/command/test_plugin_generator.rb +2 -1
- data/test/config/test_section.rb +9 -0
- data/test/config/test_system_config.rb +6 -0
- data/test/config/test_types.rb +7 -0
- data/test/plugin/in_tail/test_position_file.rb +48 -8
- data/test/plugin/test_bare_output.rb +13 -0
- data/test/plugin/test_buffer.rb +8 -2
- data/test/plugin/test_file_wrapper.rb +11 -0
- data/test/plugin/test_filter.rb +11 -0
- data/test/plugin/test_in_forward.rb +59 -83
- data/test/plugin/test_in_http.rb +46 -43
- data/test/plugin/test_in_monitor_agent.rb +214 -8
- data/test/plugin/test_in_syslog.rb +101 -56
- data/test/plugin/test_in_tail.rb +149 -48
- data/test/plugin/test_in_tcp.rb +45 -32
- data/test/plugin/test_in_udp.rb +47 -33
- data/test/plugin/test_input.rb +11 -0
- data/test/plugin/test_metrics.rb +294 -0
- data/test/plugin/test_metrics_local.rb +96 -0
- data/test/plugin/test_multi_output.rb +25 -1
- data/test/plugin/test_out_forward.rb +103 -89
- data/test/plugin/test_out_stream.rb +18 -8
- data/test/plugin/test_output.rb +16 -0
- data/test/plugin_helper/http_server/test_route.rb +1 -1
- data/test/plugin_helper/test_child_process.rb +1 -1
- data/test/plugin_helper/test_event_emitter.rb +29 -0
- data/test/plugin_helper/test_http_server_helper.rb +33 -26
- data/test/plugin_helper/test_metrics.rb +137 -0
- data/test/plugin_helper/test_server.rb +137 -138
- data/test/plugin_helper/test_socket.rb +16 -9
- data/test/test_event_time.rb +2 -2
- data/test/test_oj_options.rb +55 -0
- data/test/test_plugin_classes.rb +102 -0
- data/test/test_root_agent.rb +30 -1
- metadata +27 -12
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -40
- data/.github/ISSUE_TEMPLATE/feature_request.md +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eab8e56529b8472ac765f6186687659e56081d0d2b21264c05f1e4550965eff6
|
4
|
+
data.tar.gz: f64f9a36befc145b9ae862f6eead5588670f5c3252ca821608ce2bc6d8649ed7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a3d652b47ce320495511a39c41d6af65825a7455e1a67c7f2c93d7a77c13737acce3c86d79de0c0a95c6a053ba3e4bf3e0dfe19767327f4ea45f489321ef8a6
|
7
|
+
data.tar.gz: 0421fa9b68bf1317ff8e44f33908f7603f4298214daa4a0438e36586eca9829b2701144e2148a4a0ccbfeaaf87dd542be4227918eeab523dd3fdbcca0a08d839
|
@@ -0,0 +1,69 @@
|
|
1
|
+
name: Bug Report
|
2
|
+
description: Create a report with a procedure for reproducing the bug
|
3
|
+
body:
|
4
|
+
- type: markdown
|
5
|
+
attributes:
|
6
|
+
value: |
|
7
|
+
Check [CONTRIBUTING guideline](https://github.com/fluent/fluentd/blob/master/CONTRIBUTING.md) first and here is the list to help us investigate the problem.
|
8
|
+
- type: textarea
|
9
|
+
id: description
|
10
|
+
attributes:
|
11
|
+
label: Describe the bug
|
12
|
+
description: A clear and concise description of what the bug is
|
13
|
+
validations:
|
14
|
+
required: true
|
15
|
+
- type: textarea
|
16
|
+
id: reproduce
|
17
|
+
attributes:
|
18
|
+
label: To Reproduce
|
19
|
+
description: Steps to reproduce the behavior
|
20
|
+
validations:
|
21
|
+
required: true
|
22
|
+
- type: textarea
|
23
|
+
id: expected
|
24
|
+
attributes:
|
25
|
+
label: Expected behavior
|
26
|
+
description: A clear and concise description of what you expected to happen
|
27
|
+
validations:
|
28
|
+
required: true
|
29
|
+
- type: textarea
|
30
|
+
id: environment
|
31
|
+
attributes:
|
32
|
+
label: Your Environment
|
33
|
+
description: |
|
34
|
+
- Fluentd or td-agent version: `fluentd --version` or `td-agent --version`
|
35
|
+
- Operating system: `cat /etc/os-release`
|
36
|
+
- Kernel version: `uname -r`
|
37
|
+
|
38
|
+
Tip: If you hit the problem with older fluentd version, try latest version first.
|
39
|
+
value: |
|
40
|
+
- Fluentd version:
|
41
|
+
- TD Agent version:
|
42
|
+
- Operating system:
|
43
|
+
- Kernel version:
|
44
|
+
render: markdown
|
45
|
+
validations:
|
46
|
+
required: true
|
47
|
+
- type: textarea
|
48
|
+
id: configuration
|
49
|
+
attributes:
|
50
|
+
label: Your Configuration
|
51
|
+
description: |
|
52
|
+
Write your configuration here. Minimum reproducible fluentd.conf is recommended.
|
53
|
+
validations:
|
54
|
+
required: true
|
55
|
+
- type: textarea
|
56
|
+
id: logs
|
57
|
+
attributes:
|
58
|
+
label: Your Error Log
|
59
|
+
description: Write your ALL error log here
|
60
|
+
render: shell
|
61
|
+
validations:
|
62
|
+
required: true
|
63
|
+
- type: textarea
|
64
|
+
id: addtional-context
|
65
|
+
attributes:
|
66
|
+
label: Additional context
|
67
|
+
description: Add any other context about the problem here.
|
68
|
+
validations:
|
69
|
+
required: false
|
@@ -0,0 +1,38 @@
|
|
1
|
+
name: Feature request
|
2
|
+
description: Suggest an idea for this project
|
3
|
+
body:
|
4
|
+
- type: markdown
|
5
|
+
attributes:
|
6
|
+
value: |
|
7
|
+
Check [CONTRIBUTING guideline](https://github.com/fluent/fluentd/blob/master/CONTRIBUTING.md) first and here is the list to help us investigate the problem.
|
8
|
+
- type: textarea
|
9
|
+
id: description
|
10
|
+
attributes:
|
11
|
+
label: Is your feature request related to a problem? Please describe.
|
12
|
+
description: |
|
13
|
+
A clear and concise description of what the problem is.
|
14
|
+
Ex. I'm always frustrated when [...]
|
15
|
+
validations:
|
16
|
+
required: true
|
17
|
+
- type: textarea
|
18
|
+
id: solution
|
19
|
+
attributes:
|
20
|
+
label: Describe the solution you'd like
|
21
|
+
description: A clear and concise description of what you want to happen.
|
22
|
+
validations:
|
23
|
+
required: true
|
24
|
+
- type: textarea
|
25
|
+
id: alternative
|
26
|
+
attributes:
|
27
|
+
label: Describe alternatives you've considered
|
28
|
+
description: A clear and concise description of any alternative solutions or features you've considered.
|
29
|
+
validations:
|
30
|
+
required: true
|
31
|
+
- type: textarea
|
32
|
+
id: addtional-context
|
33
|
+
attributes:
|
34
|
+
label: Additional context
|
35
|
+
description: Add any other context or screenshots about the feature request here.
|
36
|
+
validations:
|
37
|
+
required: false
|
38
|
+
|
data/.gitlab-ci.yml
CHANGED
@@ -13,16 +13,6 @@ stages:
|
|
13
13
|
- build
|
14
14
|
- tests
|
15
15
|
|
16
|
-
2-5-8:
|
17
|
-
image: "ruby:2.5.8"
|
18
|
-
stage: build
|
19
|
-
extends: .install-template
|
20
|
-
script:
|
21
|
-
- bundle install --jobs=3 --retry=3
|
22
|
-
cache:
|
23
|
-
key: "$CI_COMMIT_REF_SLUG 2-5-8"
|
24
|
-
paths:
|
25
|
-
|
26
16
|
2-6-6:
|
27
17
|
image: "ruby:2.6.6"
|
28
18
|
stage: build
|
@@ -64,18 +54,6 @@ rubyhead:
|
|
64
54
|
paths:
|
65
55
|
- ./*
|
66
56
|
|
67
|
-
2-5-8-test:
|
68
|
-
image: "ruby:2.5.8"
|
69
|
-
stage: tests
|
70
|
-
allow_failure: true
|
71
|
-
extends: .test-template
|
72
|
-
script:
|
73
|
-
- bundle exec rake test
|
74
|
-
cache:
|
75
|
-
key: "$CI_COMMIT_REF_SLUG 2-5-8"
|
76
|
-
paths:
|
77
|
-
- ./*
|
78
|
-
|
79
57
|
2-6-6-test:
|
80
58
|
image: "ruby:2.6.6"
|
81
59
|
stage: tests
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,90 @@
|
|
1
|
+
# v1.13.3
|
2
|
+
|
3
|
+
## Release v1.13.3 - 2021/07/27
|
4
|
+
|
5
|
+
### Bug fix
|
6
|
+
|
7
|
+
* in_tail: Care DeletePending state on Windows
|
8
|
+
https://github.com/fluent/fluentd/pull/3457
|
9
|
+
https://github.com/fluent/fluentd/pull/3460
|
10
|
+
* in_tail: Fix some pos_file bugs.
|
11
|
+
Avoid deleting pos_file entries unexpectedly when both
|
12
|
+
`pos_file_compaction_interval` and `follow_inode` are enabled.
|
13
|
+
Use `bytesize` instead of `size` for path length.
|
14
|
+
https://github.com/fluent/fluentd/pull/3459
|
15
|
+
* in_tail: Fix detecting rotation twice on `follow_inode`.
|
16
|
+
https://github.com/fluent/fluentd/pull/3466
|
17
|
+
|
18
|
+
### Misc
|
19
|
+
|
20
|
+
* Remove needless spaces in a sample config file
|
21
|
+
https://github.com/fluent/fluentd/pull/3456
|
22
|
+
|
23
|
+
### Enhancement
|
24
|
+
|
25
|
+
# v1.13.2
|
26
|
+
|
27
|
+
## Release v1.13.2 - 2021/07/12
|
28
|
+
|
29
|
+
### Enhancement
|
30
|
+
|
31
|
+
* fluent-plugin-generate: Storage plugin was supported.
|
32
|
+
https://github.com/fluent/fluentd/pull/3426
|
33
|
+
* parser_json: Added support to customize configuration of oj options.
|
34
|
+
Use `FLUENT_OJ_OPTION_BIGDECIMAL_LOAD`, `FLUENT_OJ_OPTION_MAX_NESTING`,
|
35
|
+
`FLUENT_OJ_OPTION_MODE`, and `FLUENT_OJ_OPTION_USE_TO_JSON` environment
|
36
|
+
variable to configure it.
|
37
|
+
https://github.com/fluent/fluentd/pull/3315
|
38
|
+
|
39
|
+
### Bug fix
|
40
|
+
|
41
|
+
* binlog_reader: Fixed a crash bug by missing "fluent/env" dependency.
|
42
|
+
https://github.com/fluent/fluentd/pull/3443
|
43
|
+
* Fixed a crash bug on outputting log at the early stage when parsing
|
44
|
+
config file. This is a regression since v1.13.0. If you use invalid
|
45
|
+
'@' prefix parameter, remove it as a workaround.
|
46
|
+
https://github.com/fluent/fluentd/pull/3451
|
47
|
+
* in_tail: Fixed a bug that when rotation is occurred, remaining lines
|
48
|
+
will be discarded if the throttling feature is enabled.
|
49
|
+
https://github.com/fluent/fluentd/pull/3390
|
50
|
+
* fluent-plugin-generate: Fixed a crash bug during gemspec generation.
|
51
|
+
It was unexpectedly introduced by #3305, thus this bug was a
|
52
|
+
regression since 1.12.3.
|
53
|
+
https://github.com/fluent/fluentd/pull/3444
|
54
|
+
|
55
|
+
### Misc
|
56
|
+
|
57
|
+
* Fixed the runtime dependency version of http_parse.rb to 0.7.0.
|
58
|
+
It was fixed because false positive detection is occurred frequently
|
59
|
+
by security scanning tools.
|
60
|
+
https://github.com/fluent/fluentd/pull/3450
|
61
|
+
|
62
|
+
# v1.13.1
|
63
|
+
|
64
|
+
## Release v1.13.1 - 2021/06/25
|
65
|
+
|
66
|
+
### Bug fix
|
67
|
+
|
68
|
+
* out_forward: Fixed a race condition on handshake
|
69
|
+
It's caused by using a same unpacker from multiple threads.
|
70
|
+
https://github.com/fluent/fluentd/pull/3405
|
71
|
+
https://github.com/fluent/fluentd/pull/3406
|
72
|
+
* in_tail: Fixed to remove too much verbose debugging logs
|
73
|
+
It was unexpectedly introduced by #3185 log throttling feature.
|
74
|
+
https://github.com/fluent/fluentd/pull/3418
|
75
|
+
* Fixed not to echo back the provides path as is on a 404 error
|
76
|
+
There was a potential cross-site scripting vector even though
|
77
|
+
it is quite difficult to exploit.
|
78
|
+
https://github.com/fluent/fluentd/pull/3427
|
79
|
+
|
80
|
+
### Misc
|
81
|
+
|
82
|
+
* Pretty print for Fluent::Config::Section has been supported
|
83
|
+
for debugging
|
84
|
+
https://github.com/fluent/fluentd/pull/3398
|
85
|
+
* CI: Dropped to run CI for Ruby 2.5
|
86
|
+
https://github.com/fluent/fluentd/pull/3412
|
87
|
+
|
1
88
|
# v1.13
|
2
89
|
|
3
90
|
## Release v1.13.0 - 2021/05/29
|
data/README.md
CHANGED
@@ -25,9 +25,9 @@ An event consists of *tag*, *time* and *record*. Tag is a string separated with
|
|
25
25
|
|
26
26
|
Use Case | Description | Diagram
|
27
27
|
-------- | ------------|:---------:
|
28
|
-
Centralizing Apache/Nginx Server Logs | Fluentd can be used to tail access/error logs and transport them reliably to remote systems. | <img src="https://www.fluentd.org/
|
28
|
+
Centralizing Apache/Nginx Server Logs | Fluentd can be used to tail access/error logs and transport them reliably to remote systems. | <img src="https://www.fluentd.org/images/recipes/elasticsearch-s3-fluentd.png" height="150"/>
|
29
29
|
Syslog Alerting | Fluentd can "grep" for events and send out alerts. | <img src="https://www.fluentd.org/images/syslog-fluentd-alert.png" height="100"/>
|
30
|
-
Mobile/Web Application Logging | Fluentd can function as middleware to enable asynchronous, scalable logging for user action events. | <img src="https://www.fluentd.org/
|
30
|
+
Mobile/Web Application Logging | Fluentd can function as middleware to enable asynchronous, scalable logging for user action events. | <img src="https://www.fluentd.org/images/datasources/asynchronous_logging.png" height="150"/>
|
31
31
|
|
32
32
|
## Quick Start
|
33
33
|
|
data/example/v0_12_filter.conf
CHANGED
@@ -52,10 +52,10 @@
|
|
52
52
|
</match>
|
53
53
|
|
54
54
|
# Composing two filters. For all events with the tag foo.bar,
|
55
|
-
#
|
55
|
+
#
|
56
56
|
# 1. The first filter filters out all events that has the field "hello"
|
57
57
|
# 2. Then, for those events, we downcase the value of the "name" field.
|
58
|
-
#
|
58
|
+
#
|
59
59
|
# - {"name":"SADA", "hello":100} gets filtered out
|
60
60
|
# - {"name":"SADA"} becomes {"name":"sada"}
|
61
61
|
# - {"last_name":"FURUHASHI"} throws an error because it has no field called "name"
|
data/fluentd.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
|
|
23
23
|
gem.add_runtime_dependency("yajl-ruby", ["~> 1.0"])
|
24
24
|
gem.add_runtime_dependency("cool.io", [">= 1.4.5", "< 2.0.0"])
|
25
25
|
gem.add_runtime_dependency("serverengine", [">= 2.2.2", "< 3.0.0"])
|
26
|
-
gem.add_runtime_dependency("http_parser.rb", [">= 0.5.1", "< 0.
|
26
|
+
gem.add_runtime_dependency("http_parser.rb", [">= 0.5.1", "< 0.8.0"])
|
27
27
|
gem.add_runtime_dependency("sigdump", ["~> 0.2.2"])
|
28
28
|
gem.add_runtime_dependency("tzinfo", [">= 1.0", "< 3.0"])
|
29
29
|
gem.add_runtime_dependency("tzinfo-data", ["~> 1.0"])
|
@@ -134,6 +134,14 @@ op.on('--strict-config-value', "Parse config values strictly", TrueClass) {|b|
|
|
134
134
|
opts[:strict_config_value] = b
|
135
135
|
}
|
136
136
|
|
137
|
+
op.on('--enable-input-metrics', "Enable input plugin metrics on fluentd", TrueClass) {|b|
|
138
|
+
opts[:enable_input_metrics] = b
|
139
|
+
}
|
140
|
+
|
141
|
+
op.on('--enable-size-metrics', "Enable plugin record size metrics on fluentd", TrueClass) {|b|
|
142
|
+
opts[:enable_size_metrics] = b
|
143
|
+
}
|
144
|
+
|
137
145
|
op.on('-v', '--verbose', "increase verbose level (-v: debug, -vv: trace)", TrueClass) {|b|
|
138
146
|
if b
|
139
147
|
opts[:log_level] = [opts[:log_level] - 1, Fluent::Log::LEVEL_TRACE].max
|
@@ -27,7 +27,7 @@ class FluentPluginGenerator
|
|
27
27
|
attr_reader :type, :name
|
28
28
|
attr_reader :license_name
|
29
29
|
|
30
|
-
SUPPORTED_TYPES = ["input", "output", "filter", "parser", "formatter"]
|
30
|
+
SUPPORTED_TYPES = ["input", "output", "filter", "parser", "formatter", "storage"]
|
31
31
|
|
32
32
|
def initialize(argv = ARGV)
|
33
33
|
@argv = argv
|
@@ -164,8 +164,13 @@ BANNER
|
|
164
164
|
end
|
165
165
|
|
166
166
|
def locked_gem_version(gem_name)
|
167
|
-
|
168
|
-
|
167
|
+
if File.exist?(lock_file_path)
|
168
|
+
d = Bundler::Definition.build(gem_file_path, lock_file_path, false)
|
169
|
+
d.locked_gems.dependencies[gem_name].requirement.requirements.first.last.version
|
170
|
+
else
|
171
|
+
# fallback even though Fluentd is installed without bundler
|
172
|
+
Gem::Specification.find_by_name(gem_name).version.version
|
173
|
+
end
|
169
174
|
end
|
170
175
|
|
171
176
|
def rake_version
|
@@ -177,8 +182,13 @@ BANNER
|
|
177
182
|
end
|
178
183
|
|
179
184
|
def bundler_version
|
180
|
-
|
181
|
-
|
185
|
+
if File.exist?(lock_file_path)
|
186
|
+
d = Bundler::Definition.build(gem_file_path, lock_file_path, false)
|
187
|
+
d.locked_gems.bundler_version.version
|
188
|
+
else
|
189
|
+
# fallback even though Fluentd is installed without bundler
|
190
|
+
Gem::Specification.find_by_name("bundler").version.version
|
191
|
+
end
|
182
192
|
end
|
183
193
|
|
184
194
|
def class_name
|
data/lib/fluent/compat/output.rb
CHANGED
@@ -310,7 +310,7 @@ module Fluent
|
|
310
310
|
# original implementation of v0.12 BufferedOutput
|
311
311
|
def emit(tag, es, chain, key="")
|
312
312
|
# this method will not be used except for the case that plugin calls super
|
313
|
-
@
|
313
|
+
@emit_count_metrics.inc
|
314
314
|
data = format_stream(tag, es)
|
315
315
|
if @buffer.emit(key, data, chain)
|
316
316
|
submit_flush
|
@@ -337,14 +337,14 @@ module Fluent
|
|
337
337
|
# because v0.12 BufferedOutput may overrides #format_stream, but original #handle_stream_simple method doesn't consider about it
|
338
338
|
def handle_stream_simple(tag, es, enqueue: false)
|
339
339
|
if @overrides_emit
|
340
|
-
current_emit_count = @
|
340
|
+
current_emit_count = @emit_count_metrics.get
|
341
341
|
size = es.size
|
342
342
|
key = data = nil
|
343
343
|
begin
|
344
344
|
emit(tag, es, NULL_OUTPUT_CHAIN)
|
345
345
|
key, data = self.last_emit_via_buffer
|
346
346
|
ensure
|
347
|
-
@
|
347
|
+
@emit_count_metrics.set(current_emit_count)
|
348
348
|
self.last_emit_via_buffer = nil
|
349
349
|
end
|
350
350
|
# on-the-fly key assignment can be done, and it's not configurable if Plugin#emit does it dynamically
|
@@ -352,7 +352,8 @@ module Fluent
|
|
352
352
|
write_guard do
|
353
353
|
@buffer.write({meta => data}, format: ->(_data){ _data }, size: ->(){ size }, enqueue: enqueue)
|
354
354
|
end
|
355
|
-
@
|
355
|
+
@emit_records_metrics.add(es.size)
|
356
|
+
@emit_size_metrics.add(es.to_msgpack_stream.bytesize) if @enable_size_metrics
|
356
357
|
return [meta]
|
357
358
|
end
|
358
359
|
|
@@ -363,7 +364,8 @@ module Fluent
|
|
363
364
|
write_guard do
|
364
365
|
@buffer.write({meta => bulk}, format: ->(_data){ _data }, size: ->(){ size }, enqueue: enqueue)
|
365
366
|
end
|
366
|
-
@
|
367
|
+
@emit_records_metrics.add(es.size)
|
368
|
+
@emit_size_metrics.add(es.to_msgpack_stream.bytesize) if @enable_size_metrics
|
367
369
|
return [meta]
|
368
370
|
end
|
369
371
|
|
@@ -373,7 +375,8 @@ module Fluent
|
|
373
375
|
write_guard do
|
374
376
|
@buffer.write({meta => data}, enqueue: enqueue)
|
375
377
|
end
|
376
|
-
@
|
378
|
+
@emit_records_metrics.add(es.size)
|
379
|
+
@emit_size_metrics.add(es.to_msgpack_stream.bytesize) if @enable_size_metrics
|
377
380
|
[meta]
|
378
381
|
end
|
379
382
|
|
data/lib/fluent/config.rb
CHANGED
@@ -62,7 +62,7 @@ module Fluent
|
|
62
62
|
Parser.parse(str, fname, basepath)
|
63
63
|
when :ruby
|
64
64
|
require 'fluent/config/dsl'
|
65
|
-
$log.warn("Ruby DSL configuration format is deprecated. Please use original configuration format. https://docs.fluentd.org/configuration/config-file")
|
65
|
+
$log.warn("Ruby DSL configuration format is deprecated. Please use original configuration format. https://docs.fluentd.org/configuration/config-file") if $log
|
66
66
|
Config::DSL::Parser.parse(str, File.join(basepath, fname))
|
67
67
|
else
|
68
68
|
raise "[BUG] unknown configuration parser specification:'#{parser}'"
|
data/lib/fluent/config/types.rb
CHANGED
@@ -20,6 +20,10 @@ require 'fluent/config/error'
|
|
20
20
|
|
21
21
|
module Fluent
|
22
22
|
module Config
|
23
|
+
def self.reformatted_value(type, val, opts = {}, name = nil)
|
24
|
+
REFORMAT_VALUE.call(type, val, opts, name)
|
25
|
+
end
|
26
|
+
|
23
27
|
def self.size_value(str, opts = {}, name = nil)
|
24
28
|
return nil if str.nil?
|
25
29
|
|
@@ -104,6 +108,16 @@ module Fluent
|
|
104
108
|
Config.string_value(val, opts, name)
|
105
109
|
}
|
106
110
|
|
111
|
+
def self.symbol_value(val, opts = {}, name = nil)
|
112
|
+
return nil if val.nil? || val.empty?
|
113
|
+
|
114
|
+
val.delete_prefix(":").to_sym
|
115
|
+
end
|
116
|
+
|
117
|
+
SYMBOL_TYPE = Proc.new { |val, opts = {}, name = nil|
|
118
|
+
Config.symbol_value(val, opts, name)
|
119
|
+
}
|
120
|
+
|
107
121
|
def self.enum_value(val, opts = {}, name = nil)
|
108
122
|
return nil if val.nil?
|
109
123
|
|
@@ -176,6 +190,7 @@ module Fluent
|
|
176
190
|
when :bool then Config.bool_value(value, opts, name)
|
177
191
|
when :time then Config.time_value(value, opts, name)
|
178
192
|
when :regexp then Config.regexp_value(value, opts, name)
|
193
|
+
when :symbol then Config.symbol_value(value, opts, name)
|
179
194
|
else
|
180
195
|
raise "unknown type in REFORMAT: #{type}"
|
181
196
|
end
|