fluentd 1.11.5-x86-mingw32 → 1.12.0-x86-mingw32

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.

Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
  3. data/.github/ISSUE_TEMPLATE/config.yml +5 -0
  4. data/.github/workflows/stale-actions.yml +22 -0
  5. data/.travis.yml +22 -2
  6. data/CHANGELOG.md +38 -0
  7. data/README.md +1 -1
  8. data/appveyor.yml +3 -0
  9. data/bin/fluent-cap-ctl +7 -0
  10. data/bin/fluent-ctl +7 -0
  11. data/fluentd.gemspec +1 -0
  12. data/lib/fluent/capability.rb +87 -0
  13. data/lib/fluent/command/cap_ctl.rb +174 -0
  14. data/lib/fluent/command/ctl.rb +177 -0
  15. data/lib/fluent/command/plugin_config_formatter.rb +2 -1
  16. data/lib/fluent/env.rb +4 -0
  17. data/lib/fluent/plugin.rb +5 -0
  18. data/lib/fluent/plugin/buffer.rb +2 -21
  19. data/lib/fluent/plugin/formatter.rb +2 -2
  20. data/lib/fluent/plugin/formatter_csv.rb +1 -1
  21. data/lib/fluent/plugin/formatter_hash.rb +1 -1
  22. data/lib/fluent/plugin/formatter_ltsv.rb +3 -3
  23. data/lib/fluent/plugin/formatter_out_file.rb +3 -3
  24. data/lib/fluent/plugin/formatter_single_value.rb +2 -2
  25. data/lib/fluent/plugin/formatter_tsv.rb +2 -2
  26. data/lib/fluent/plugin/in_http.rb +23 -2
  27. data/lib/fluent/plugin/in_tail.rb +109 -41
  28. data/lib/fluent/plugin/in_tail/position_file.rb +39 -14
  29. data/lib/fluent/plugin/in_tcp.rb +1 -0
  30. data/lib/fluent/plugin/output.rb +7 -1
  31. data/lib/fluent/plugin_helper/http_server/compat/server.rb +1 -1
  32. data/lib/fluent/plugin_helper/inject.rb +4 -2
  33. data/lib/fluent/plugin_helper/retry_state.rb +4 -0
  34. data/lib/fluent/supervisor.rb +140 -42
  35. data/lib/fluent/time.rb +1 -0
  36. data/lib/fluent/version.rb +1 -1
  37. data/lib/fluent/winsvc.rb +22 -4
  38. data/test/command/test_cap_ctl.rb +100 -0
  39. data/test/command/test_ctl.rb +57 -0
  40. data/test/command/test_plugin_config_formatter.rb +57 -2
  41. data/test/plugin/in_tail/test_position_file.rb +45 -25
  42. data/test/plugin/test_in_http.rb +25 -0
  43. data/test/plugin/test_in_tail.rb +430 -30
  44. data/test/plugin/test_parser_syslog.rb +2 -2
  45. data/test/plugin_helper/test_inject.rb +29 -0
  46. data/test/test_capability.rb +74 -0
  47. data/test/test_supervisor.rb +102 -10
  48. metadata +31 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92c950a0027fc400ff420544b3ef5d7752f7e6e1bfd2ec550006c06cd144a710
4
- data.tar.gz: b8bf17728ae2f9e07c362bab49bc98c5d0ee8f69a739da037671694187753e03
3
+ metadata.gz: cdc76f6f11cb61d39493ea75cf0c0a473f9cf8f2aeb52904b33611cddb2f7e59
4
+ data.tar.gz: e47317af7d0e5d22b6dd54e1ad3c23a77652ed3441851549699b7f8f2f7577f0
5
5
  SHA512:
6
- metadata.gz: b033abbba4279b9a800850eb42269e89a0e70a0e170e2dac47570e8026939236354d849d0e866f400e3ecd412f445de898bb63f27958e6beb9ea04e56e3b7527
7
- data.tar.gz: ef746c3a7b0433dc5e06278c6bc430a62a14ee4ccc85450545abf6647b078e32c2221b16d0b9241fcf2ab6833000ecbd00a7cdfa2e567ad9bf8f507e1897373f
6
+ metadata.gz: 55a69af50c96ab66919f00f488558353bddbb799682f1987a4e1bcef68ef93e28a9bd721735306c4aad21fd85e08f233ebf4aff79f81b42a61ced3c5fe39119e
7
+ data.tar.gz: c5a4da161a352b210cb9c57bb6f5119f2131ca86f107924bd1f45e65ed924d2e483ebe94559a80e8e054fc88badffeb53785bc65097ea903fddff3ec3ca1d811
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: Bug Report
3
- about: Create a report to help us improve. If you have questions about Fluentd and plugins, please direct these to https://groups.google.com/forum/#!forum/fluentd
3
+ about: Create a report with a procedure for reproducing the bug
4
4
 
5
5
  ---
6
6
 
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Ask a Question
4
+ url: https://groups.google.com/forum/#!forum/fluentd
5
+ about: I have questions about Fluentd and plugins. Please ask and answer questions here
@@ -0,0 +1,22 @@
1
+ name: "Mark or close stale issues and PRs"
2
+ on:
3
+ schedule:
4
+ - cron: "00 10 * * *"
5
+
6
+ jobs:
7
+ stale:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/stale@v3
11
+ with:
12
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
13
+ days-before-stale: 90
14
+ days-before-close: 30
15
+ stale-issue-message: "This issue has been automatically marked as stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 30 days"
16
+ stale-pr-message: "This PR has been automatically marked as stale because it has been open 90 days with no activity. Remove stale label or comment or this PR will be closed in 30 days"
17
+ close-issue-message: "This issue was automatically closed because of stale in 30 days"
18
+ close-pr-message: "This PR was automatically closed because of stale in 30 days"
19
+ stale-pr-label: "stale"
20
+ stale-issue-label: "stale"
21
+ exempt-issue-labels: "bug,enhancement,feature request,pending,work_in_progress,v1,v2"
22
+ exempt-pr-labels: "bug,enhancement,feature request,pending,work_in_progress,v1,v2"
@@ -9,44 +9,63 @@ matrix:
9
9
  include:
10
10
  - rvm: 2.4.9
11
11
  os: linux
12
+ env: USE_CAPNG=false
12
13
  - rvm: 2.4.9
13
14
  os: linux-ppc64le
15
+ env: USE_CAPNG=false
14
16
  - rvm: 2.5.7
15
17
  os: linux
18
+ env: USE_CAPNG=false
16
19
  - rvm: 2.5.7
17
20
  os: linux
18
21
  arch: s390x
19
22
  dist: xenial
23
+ env: USE_CAPNG=false
20
24
  - rvm: 2.6.5
21
25
  os: linux
26
+ env: USE_CAPNG=false
27
+ - rvm: 2.6.6
28
+ os: linux
29
+ env: USE_CAPNG=true
22
30
  - rvm: 2.7.0
23
31
  os: linux
32
+ env: USE_CAPNG=false
24
33
  - rvm: ruby-head
25
34
  os: linux
35
+ env: USE_CAPNG=false
26
36
  - rvm: ruby-head
27
37
  os: linux-ppc64le
38
+ env: USE_CAPNG=false
28
39
  - rvm: 2.4.6
29
40
  os: osx
30
41
  osx_image: xcode8.3 # OSX 10.12
42
+ env: USE_CAPNG=false
31
43
  - rvm: ruby-head
32
44
  os: osx
33
45
  osx_image: xcode8.3 # OSX 10.12
46
+ env: USE_CAPNG=false
34
47
  allow_failures:
35
48
  - rvm: 2.4.6
36
49
  os: osx
37
50
  osx_image: xcode8.3
51
+ env: USE_CAPNG=false
38
52
  - rvm: 2.5.7
39
53
  os: linux
40
54
  arch: s390x
41
55
  dist: xenial
56
+ env: USE_CAPNG=false
42
57
  - rvm: ruby-head
58
+ env: USE_CAPNG=false
43
59
 
44
60
  branches:
45
61
  only:
46
62
  - master
47
63
 
48
- before_install:
49
- - gem update --system=3.1.2
64
+ before_install: |
65
+ gem update --system=3.1.2
66
+ if [[ x"${USE_CAPNG}" == "xtrue" ]]; then
67
+ echo 'gem "capng_c"' >> Gemfile.local
68
+ fi
50
69
 
51
70
  sudo: false
52
71
  dist: trusty # for TLSv1.2 support
@@ -55,3 +74,4 @@ addons:
55
74
  apt:
56
75
  packages:
57
76
  - libgmp3-dev
77
+ - libcap-ng-dev
@@ -1,3 +1,40 @@
1
+ # v1.12
2
+
3
+ ## Release v1.12.0 - 2020/01/05
4
+
5
+ ### New feature
6
+
7
+ * in_tail: Add `follow_inode` to support log rotation with wild card
8
+ https://github.com/fluent/fluentd/pull/2992
9
+ * in_tail: Handle linux capability
10
+ https://github.com/fluent/fluentd/pull/3155
11
+ https://github.com/fluent/fluentd/pull/3162
12
+ * windows: Add win32 events alternative to unix signals
13
+ https://github.com/fluent/fluentd/pull/3131
14
+
15
+ ### Enhancement
16
+
17
+ * buffer: Enable metadata comparison optimization on all platform
18
+ https://github.com/fluent/fluentd/pull/3095
19
+ * fluent-plugin-config-formatter: Handle `service_discovery` type
20
+ https://github.com/fluent/fluentd/pull/3178
21
+ * in_http: Add `add_query_params` parameter to add query params to event record
22
+ https://github.com/fluent/fluentd/pull/3197
23
+ * inject: Support `unixtime_micros` and `unixtime_nanos` in `time_type`
24
+ https://github.com/fluent/fluentd/pull/3220
25
+ * Refactoring code
26
+ https://github.com/fluent/fluentd/pull/3167
27
+ https://github.com/fluent/fluentd/pull/3170
28
+ https://github.com/fluent/fluentd/pull/3180
29
+ https://github.com/fluent/fluentd/pull/3196
30
+ https://github.com/fluent/fluentd/pull/3213
31
+ https://github.com/fluent/fluentd/pull/3222
32
+
33
+ ### Bug fix
34
+
35
+ * output: Prevent retry.step from being called too many times in a short time
36
+ https://github.com/fluent/fluentd/pull/3203
37
+
1
38
  # v1.11
2
39
 
3
40
  ## Release v1.11.5 - 2020/11/06
@@ -8,6 +45,7 @@
8
45
  https://github.com/fluent/fluentd/pull/3152
9
46
  * out_http: adding support for intermediate certificates
10
47
  https://github.com/fluent/fluentd/pull/3146
48
+ * Update serverengine dependency to 2.2.2 or later
11
49
 
12
50
  ### Bug fix
13
51
 
data/README.md CHANGED
@@ -13,7 +13,7 @@ Drone CI for Arm64:
13
13
  [Fluentd](https://www.fluentd.org/) collects events from various data sources and writes them to files, RDBMS, NoSQL, IaaS, SaaS, Hadoop and so on. Fluentd helps you unify your logging infrastructure (Learn more about the [Unified Logging Layer](https://www.fluentd.org/blog/unified-logging-layer)).
14
14
 
15
15
  <p align="center">
16
- <img src="https://raw.githubusercontent.com/fluent/fluentd-docs-gitbook/1.0/images/fluentd-architecture.png" width="500px"/>
16
+ <img src="https://www.fluentd.org/images/fluentd-architecture.png" width="500px"/>
17
17
  </p>
18
18
 
19
19
  An event consists of *tag*, *time* and *record*. Tag is a string separated with '.' (e.g. myapp.access). It is used to categorize events. Time is a UNIX time recorded at occurrence of an event. Record is a JSON object.
@@ -7,6 +7,9 @@ install:
7
7
  - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
8
8
  - ruby --version
9
9
  - gem --version
10
+ # stay 0.14.0 for Windows CI until https://github.com/socketry/protocol-http2/issues/6 will be fixed
11
+ - ps: Write-Output "gem 'protocol-http2', ['<= 0.14.0']" | Out-File -FilePath Gemfile.local -Encoding default
12
+ - type Gemfile.local
10
13
  - ridk.cmd exec bundle install
11
14
  build: off
12
15
  test_script:
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+ here = File.dirname(__FILE__)
4
+ $LOAD_PATH << File.expand_path(File.join(here, '..', 'lib'))
5
+ require 'fluent/command/cap_ctl'
6
+
7
+ Fluent::CapCtl.new.call
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ here = File.dirname(__FILE__)
4
+ $LOAD_PATH << File.expand_path(File.join(here, '..', 'lib'))
5
+ require 'fluent/command/ctl'
6
+
7
+ Fluent::Ctl.new.call
@@ -18,6 +18,7 @@ Gem::Specification.new do |gem|
18
18
 
19
19
  gem.required_ruby_version = '>= 2.4'
20
20
 
21
+ gem.add_runtime_dependency("bundler")
21
22
  gem.add_runtime_dependency("msgpack", [">= 1.3.1", "< 2.0.0"])
22
23
  gem.add_runtime_dependency("yajl-ruby", ["~> 1.0"])
23
24
  gem.add_runtime_dependency("cool.io", [">= 1.4.5", "< 2.0.0"])
@@ -0,0 +1,87 @@
1
+ #
2
+ # Fluent
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/env"
18
+
19
+ if Fluent.linux?
20
+ begin
21
+ require 'capng'
22
+ rescue LoadError
23
+ end
24
+ end
25
+
26
+ module Fluent
27
+ if defined?(CapNG)
28
+ class Capability
29
+ def initialize(target = nil, pid = nil)
30
+ @capng = CapNG.new(target, pid)
31
+ end
32
+
33
+ def usable?
34
+ true
35
+ end
36
+
37
+ def apply(select_set)
38
+ @capng.apply(select_set)
39
+ end
40
+
41
+ def clear(select_set)
42
+ @capng.clear(select_set)
43
+ end
44
+
45
+ def have_capability?(type, capability)
46
+ @capng.have_capability?(type, capability)
47
+ end
48
+
49
+ def update(action, type, capability_or_capability_array)
50
+ @capng.update(action, type, capability_or_capability_array)
51
+ end
52
+
53
+ def have_capabilities?(select_set)
54
+ @capng.have_capabilities?(select_set)
55
+ end
56
+ end
57
+ else
58
+ class Capability
59
+ def initialize(target = nil, pid = nil)
60
+ end
61
+
62
+ def usable?
63
+ false
64
+ end
65
+
66
+ def apply(select_set)
67
+ false
68
+ end
69
+
70
+ def clear(select_set)
71
+ false
72
+ end
73
+
74
+ def have_capability?(type, capability)
75
+ false
76
+ end
77
+
78
+ def update(action, type, capability_or_capability_array)
79
+ false
80
+ end
81
+
82
+ def have_capabilities?(select_set)
83
+ false
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,174 @@
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 'optparse'
18
+ require 'fluent/log'
19
+ require 'fluent/env'
20
+ require 'fluent/capability'
21
+
22
+ module Fluent
23
+ class CapCtl
24
+ def prepare_option_parser
25
+ @op = OptionParser.new
26
+
27
+ @op.on('--clear', "Clear Fluentd Ruby capability") {|s|
28
+ @opts[:clear_capabilities] = true
29
+ }
30
+
31
+ @op.on('--add [CAPABILITITY1,CAPABILITY2, ...]', "Add capabilities into Fluentd Ruby") {|s|
32
+ @opts[:add_capabilities] = s
33
+ }
34
+
35
+ @op.on('--drop [CAPABILITITY1,CAPABILITY2, ...]', "Drop capabilities from Fluentd Ruby") {|s|
36
+ @opts[:drop_capabilities] = s
37
+ }
38
+
39
+ @op.on('--get', "Get capabilities for Fluentd Ruby") {|s|
40
+ @opts[:get_capabilities] = true
41
+ }
42
+
43
+ @op.on('-f', '--file FILE', "Specify target file to add Linux capabilities") {|s|
44
+ @opts[:target_file] = s
45
+ }
46
+ end
47
+
48
+ def usage(msg)
49
+ puts @op.to_s
50
+ puts "error: #{msg}" if msg
51
+ exit 1
52
+ end
53
+
54
+ def initialize(argv = ARGV)
55
+ @opts = {}
56
+ @argv = argv
57
+
58
+ if Fluent.linux?
59
+ begin
60
+ require 'capng'
61
+
62
+ @capng = CapNG.new
63
+ rescue LoadError
64
+ puts "Error: capng_c is not loaded. Please install it first."
65
+ exit 1
66
+ end
67
+ else
68
+ puts "Error: This environment is not supported."
69
+ exit 2
70
+ end
71
+
72
+ prepare_option_parser
73
+ end
74
+
75
+ def call
76
+ parse_options!(@argv)
77
+
78
+ target_file = if !!@opts[:target_file]
79
+ @opts[:target_file]
80
+ else
81
+ File.readlink("/proc/self/exe")
82
+ end
83
+
84
+ if @opts[:clear_capabilities]
85
+ clear_capabilities(@opts, target_file)
86
+ elsif @opts[:add_capabilities]
87
+ add_capabilities(@opts, target_file)
88
+ elsif @opts[:drop_capabilities]
89
+ drop_capabilities(@opts, target_file)
90
+ end
91
+ if @opts[:get_capabilities]
92
+ get_capabilities(@opts, target_file)
93
+ end
94
+ end
95
+
96
+ def clear_capabilities(opts, target_file)
97
+ if !!opts[:clear_capabilities]
98
+ @capng.clear(:caps)
99
+ ret = @capng.apply_caps_file(target_file)
100
+ puts "Clear capabilities #{ret ? 'done' : 'fail'}."
101
+ end
102
+ end
103
+
104
+ def add_capabilities(opts, target_file)
105
+ if add_caps = opts[:add_capabilities]
106
+ @capng.clear(:caps)
107
+ @capng.caps_file(target_file)
108
+ capabilities = add_caps.split(/\s*,\s*/)
109
+ check_capabilities(capabilities, get_valid_capabilities)
110
+ ret = @capng.update(:add,
111
+ CapNG::Type::EFFECTIVE | CapNG::Type::INHERITABLE | CapNG::Type::PERMITTED,
112
+ capabilities)
113
+ puts "Updating #{add_caps} #{ret ? 'done' : 'fail'}."
114
+ ret = @capng.apply_caps_file(target_file)
115
+ puts "Adding #{add_caps} #{ret ? 'done' : 'fail'}."
116
+ end
117
+ end
118
+
119
+ def drop_capabilities(opts, target_file)
120
+ if drop_caps = opts[:drop_capabilities]
121
+ @capng.clear(:caps)
122
+ @capng.caps_file(target_file)
123
+ capabilities = drop_caps.split(/\s*,\s*/)
124
+ check_capabilities(capabilities, get_valid_capabilities)
125
+ ret = @capng.update(:drop,
126
+ CapNG::Type::EFFECTIVE | CapNG::Type::INHERITABLE | CapNG::Type::PERMITTED,
127
+ capabilities)
128
+ puts "Updating #{drop_caps} #{ret ? 'done' : 'fail'}."
129
+ @capng.apply_caps_file(target_file)
130
+ puts "Dropping #{drop_caps} #{ret ? 'done' : 'fail'}."
131
+ end
132
+ end
133
+
134
+ def get_capabilities(opts, target_file)
135
+ if opts[:get_capabilities]
136
+ @capng.caps_file(target_file)
137
+ print = CapNG::Print.new
138
+ puts "Capabilities in '#{target_file}',"
139
+ puts "Effective: #{print.caps_text(:buffer, :effective)}"
140
+ puts "Inheritable: #{print.caps_text(:buffer, :inheritable)}"
141
+ puts "Permitted: #{print.caps_text(:buffer, :permitted)}"
142
+ end
143
+ end
144
+
145
+ def get_valid_capabilities
146
+ capabilities = []
147
+ cap = CapNG::Capability.new
148
+ cap.each do |_code, capability|
149
+ capabilities << capability
150
+ end
151
+ capabilities
152
+ end
153
+
154
+ def check_capabilities(capabilities, valid_capabilities)
155
+ capabilities.each do |capability|
156
+ unless valid_capabilities.include?(capability)
157
+ raise ArgumentError, "'#{capability}' is not valid capability. Valid Capabilities are: #{valid_capabilities.join(", ")}"
158
+ end
159
+ end
160
+ end
161
+
162
+ def parse_options!(argv)
163
+ begin
164
+ rest = @op.parse(argv)
165
+
166
+ if rest.length != 0
167
+ usage nil
168
+ end
169
+ rescue
170
+ usage $!.to_s
171
+ end
172
+ end
173
+ end
174
+ end