fluentd 1.15.3 → 1.16.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/bug_report.yaml +1 -0
  3. data/.github/ISSUE_TEMPLATE/feature_request.yaml +1 -0
  4. data/.github/workflows/linux-test.yaml +2 -2
  5. data/.github/workflows/macos-test.yaml +2 -2
  6. data/.github/workflows/stale-actions.yml +24 -0
  7. data/.github/workflows/windows-test.yaml +2 -2
  8. data/CHANGELOG.md +151 -0
  9. data/CONTRIBUTING.md +1 -1
  10. data/MAINTAINERS.md +5 -3
  11. data/README.md +0 -1
  12. data/SECURITY.md +5 -9
  13. data/fluentd.gemspec +3 -3
  14. data/lib/fluent/command/ctl.rb +2 -2
  15. data/lib/fluent/command/fluentd.rb +55 -53
  16. data/lib/fluent/command/plugin_config_formatter.rb +1 -1
  17. data/lib/fluent/config/dsl.rb +1 -1
  18. data/lib/fluent/config/v1_parser.rb +2 -2
  19. data/lib/fluent/counter/server.rb +1 -1
  20. data/lib/fluent/counter/validator.rb +3 -3
  21. data/lib/fluent/daemon.rb +2 -4
  22. data/lib/fluent/engine.rb +1 -1
  23. data/lib/fluent/event.rb +8 -4
  24. data/lib/fluent/log/console_adapter.rb +66 -0
  25. data/lib/fluent/log.rb +44 -5
  26. data/lib/fluent/match.rb +1 -1
  27. data/lib/fluent/msgpack_factory.rb +6 -1
  28. data/lib/fluent/plugin/base.rb +6 -8
  29. data/lib/fluent/plugin/buf_file.rb +32 -3
  30. data/lib/fluent/plugin/buf_file_single.rb +32 -3
  31. data/lib/fluent/plugin/buffer/file_chunk.rb +1 -1
  32. data/lib/fluent/plugin/buffer.rb +21 -0
  33. data/lib/fluent/plugin/filter_record_transformer.rb +1 -1
  34. data/lib/fluent/plugin/in_forward.rb +1 -1
  35. data/lib/fluent/plugin/in_http.rb +8 -8
  36. data/lib/fluent/plugin/in_sample.rb +1 -1
  37. data/lib/fluent/plugin/in_tail/position_file.rb +32 -18
  38. data/lib/fluent/plugin/in_tail.rb +58 -24
  39. data/lib/fluent/plugin/in_tcp.rb +47 -2
  40. data/lib/fluent/plugin/out_exec_filter.rb +2 -2
  41. data/lib/fluent/plugin/out_forward/ack_handler.rb +19 -4
  42. data/lib/fluent/plugin/out_forward.rb +2 -2
  43. data/lib/fluent/plugin/out_secondary_file.rb +39 -22
  44. data/lib/fluent/plugin/output.rb +50 -13
  45. data/lib/fluent/plugin/parser_json.rb +1 -1
  46. data/lib/fluent/plugin_helper/event_loop.rb +2 -2
  47. data/lib/fluent/plugin_helper/http_server/server.rb +2 -1
  48. data/lib/fluent/plugin_helper/record_accessor.rb +1 -1
  49. data/lib/fluent/plugin_helper/server.rb +8 -0
  50. data/lib/fluent/plugin_helper/thread.rb +3 -3
  51. data/lib/fluent/plugin_id.rb +1 -1
  52. data/lib/fluent/supervisor.rb +157 -251
  53. data/lib/fluent/test/driver/base.rb +11 -5
  54. data/lib/fluent/test/driver/filter.rb +4 -0
  55. data/lib/fluent/test/startup_shutdown.rb +6 -8
  56. data/lib/fluent/version.rb +1 -1
  57. data/templates/new_gem/test/helper.rb.erb +0 -1
  58. data/test/command/test_ctl.rb +1 -1
  59. data/test/command/test_fluentd.rb +137 -6
  60. data/test/command/test_plugin_config_formatter.rb +0 -1
  61. data/test/compat/test_parser.rb +5 -5
  62. data/test/config/test_system_config.rb +0 -8
  63. data/test/log/test_console_adapter.rb +110 -0
  64. data/test/plugin/in_tail/test_position_file.rb +31 -1
  65. data/test/plugin/out_forward/test_ack_handler.rb +39 -0
  66. data/test/plugin/test_base.rb +99 -1
  67. data/test/plugin/test_buf_file.rb +62 -23
  68. data/test/plugin/test_buf_file_single.rb +65 -0
  69. data/test/plugin/test_buffer_chunk.rb +11 -0
  70. data/test/plugin/test_in_forward.rb +9 -9
  71. data/test/plugin/test_in_http.rb +2 -3
  72. data/test/plugin/test_in_monitor_agent.rb +2 -3
  73. data/test/plugin/test_in_tail.rb +379 -0
  74. data/test/plugin/test_in_tcp.rb +87 -2
  75. data/test/plugin/test_in_udp.rb +28 -0
  76. data/test/plugin/test_in_unix.rb +2 -2
  77. data/test/plugin/test_multi_output.rb +1 -1
  78. data/test/plugin/test_out_exec_filter.rb +2 -2
  79. data/test/plugin/test_out_file.rb +2 -2
  80. data/test/plugin/test_out_forward.rb +14 -18
  81. data/test/plugin/test_out_http.rb +1 -0
  82. data/test/plugin/test_output.rb +281 -12
  83. data/test/plugin/test_output_as_buffered.rb +44 -44
  84. data/test/plugin/test_output_as_buffered_compress.rb +32 -18
  85. data/test/plugin/test_output_as_buffered_retries.rb +1 -1
  86. data/test/plugin/test_output_as_buffered_secondary.rb +2 -2
  87. data/test/plugin/test_parser_regexp.rb +1 -6
  88. data/test/plugin_helper/test_child_process.rb +2 -2
  89. data/test/plugin_helper/test_http_server_helper.rb +1 -1
  90. data/test/plugin_helper/test_server.rb +60 -6
  91. data/test/test_config.rb +0 -21
  92. data/test/test_formatter.rb +23 -20
  93. data/test/test_log.rb +108 -36
  94. data/test/test_msgpack_factory.rb +32 -0
  95. data/test/test_supervisor.rb +287 -279
  96. metadata +15 -21
  97. data/.drone.yml +0 -35
  98. data/.gitlab-ci.yml +0 -103
  99. data/test/test_logger_initializer.rb +0 -46
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e7d3798a39136da859e23e8bee742d8db252f58ce410cc530710d60dba36c05
4
- data.tar.gz: 82146c03770da1ebbad670fbd356a3020846f27d72e1eaeaed9538fc0b99c9cb
3
+ metadata.gz: 8eeb70b106cf175aa20210905408fa1e62e64517178f0f3d84632da1c9f99b17
4
+ data.tar.gz: f5364f2dc5abe89704b697930eb7f867bec4252b56cbdff0c3c20c3946ef8b10
5
5
  SHA512:
6
- metadata.gz: 4b895809bf5e79c5fea8e5a77a485129d8a5912327fb7cbfc176a85e77918068cf24db37cf6e8fba53f24bbdb7e6af7d593a621bcad575faf4299589c8cb662c
7
- data.tar.gz: a0985cfd48858c88f7ec9feb5c87e035361998ae50be98d6f486d9ae897cce350cf1878cd4a2491c40c6faa5a1cb67b3c52484d1100694bb624894635b8bebd6
6
+ metadata.gz: ccf34c37e7b0a0072fffd9ff13e41352b51f445801c2bc10777755fbe45b7f29beeb7d15be8e9e062f3474a5213cd46d0a720dff871df0140635f5a71ca67934
7
+ data.tar.gz: 5b0084f3a2837cd7e9a9141743006e8a941164b5faf821500d1f9aa7c5ef02e557d2018d22933b2861cfbe63085a8343b87efbb171f4a9da9f523a4af2dc5637
@@ -1,5 +1,6 @@
1
1
  name: Bug Report
2
2
  description: Create a report with a procedure for reproducing the bug
3
+ labels: "waiting-for-triage"
3
4
  body:
4
5
  - type: markdown
5
6
  attributes:
@@ -1,5 +1,6 @@
1
1
  name: Feature request
2
2
  description: Suggest an idea for this project
3
+ labels: "waiting-for-triage"
3
4
  body:
4
5
  - type: markdown
5
6
  attributes:
@@ -13,7 +13,7 @@ jobs:
13
13
  strategy:
14
14
  fail-fast: false
15
15
  matrix:
16
- ruby-version: ['3.1', '3.0', '2.7']
16
+ ruby-version: ['3.2', '3.1', '3.0', '2.7']
17
17
  os: [ubuntu-latest]
18
18
  experimental: [false]
19
19
  include:
@@ -23,7 +23,7 @@ jobs:
23
23
 
24
24
  name: Unit testing with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
25
25
  steps:
26
- - uses: actions/checkout@v2
26
+ - uses: actions/checkout@v3
27
27
  - name: Set up Ruby
28
28
  uses: ruby/setup-ruby@v1
29
29
  with:
@@ -13,7 +13,7 @@ jobs:
13
13
  strategy:
14
14
  fail-fast: false
15
15
  matrix:
16
- ruby-version: ['3.1', '3.0', '2.7']
16
+ ruby-version: ['3.2', '3.1', '3.0', '2.7']
17
17
  os: [macos-latest]
18
18
  experimental: [true]
19
19
  include:
@@ -23,7 +23,7 @@ jobs:
23
23
 
24
24
  name: Unit testing with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
25
25
  steps:
26
- - uses: actions/checkout@v2
26
+ - uses: actions/checkout@v3
27
27
  - name: Set up Ruby
28
28
  uses: ruby/setup-ruby@v1
29
29
  with:
@@ -0,0 +1,24 @@
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@v8
11
+ with:
12
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
13
+ days-before-stale: 30
14
+ days-before-close: 7
15
+ stale-issue-message: "This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 7 days"
16
+ stale-pr-message: "This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 7 days"
17
+ close-issue-message: "This issue was automatically closed because of stale in 7 days"
18
+ close-pr-message: "This PR was automatically closed because of stale in 7 days"
19
+ stale-pr-label: "stale"
20
+ stale-issue-label: "stale"
21
+ exempt-issue-labels: "waiting-for-triage,bug,enhancement,feature request,pending,work_in_progress,v1,v2"
22
+ exempt-pr-labels: "waiting-for-triage,bug,enhancement,feature request,pending,work_in_progress,v1,v2"
23
+ exempt-all-assignees: true
24
+ exempt-all-milestones: true
@@ -13,7 +13,7 @@ jobs:
13
13
  strategy:
14
14
  fail-fast: false
15
15
  matrix:
16
- ruby-version: ['3.1', '2.7']
16
+ ruby-version: ['3.2', '3.1', '2.7']
17
17
  os:
18
18
  - windows-latest
19
19
  experimental: [false]
@@ -35,7 +35,7 @@ jobs:
35
35
 
36
36
  name: Unit testing with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
37
37
  steps:
38
- - uses: actions/checkout@v2
38
+ - uses: actions/checkout@v3
39
39
  - name: Set up Ruby
40
40
  uses: ruby/setup-ruby@v1
41
41
  with:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,154 @@
1
+ # v1.16
2
+
3
+ ## Release v1.16.2 - 2023/07/14
4
+
5
+ ### Bug Fix
6
+
7
+ * in_tail: Fix new watcher is wrongly detached on rotation when `follow_inodes`,
8
+ which causes stopping tailing the file
9
+ https://github.com/fluent/fluentd/pull/4208
10
+ * in_tail: Prevent wrongly unwatching when `follow_inodes`, which causes log
11
+ duplication
12
+ https://github.com/fluent/fluentd/pull/4237
13
+ * in_tail: Fix warning log about overwriting entry when `follow_inodes`
14
+ https://github.com/fluent/fluentd/pull/4214
15
+ * in_tail: Ensure to discard TailWatcher with missing target when `follow_inodes`
16
+ https://github.com/fluent/fluentd/pull/4239
17
+ * MessagePackFactory: Make sure to reset local unpacker to prevent received
18
+ broken data from affecting other receiving data
19
+ https://github.com/fluent/fluentd/pull/4178
20
+ * Fix failure to launch Fluentd on Windows when the log path isn't specified in
21
+ the command line
22
+ https://github.com/fluent/fluentd/pull/4188
23
+ * logger: Prevent growing cache size of `ignore_same_log_interval` unlimitedly
24
+ https://github.com/fluent/fluentd/pull/4229
25
+ * Update sigdump to 0.2.5 to fix wrong value of object counts
26
+ https://github.com/fluent/fluentd/pull/4225
27
+
28
+ ### Misc
29
+
30
+ * in_tail: Check detaching inode when `follow_inodes`
31
+ https://github.com/fluent/fluentd/pull/4191
32
+ * in_tail: Add debug log for pos file compaction
33
+ https://github.com/fluent/fluentd/pull/4228
34
+ * Code improvements detected by RuboCop Performance
35
+ https://github.com/fluent/fluentd/pull/4201
36
+ https://github.com/fluent/fluentd/pull/4210
37
+ * Add notice for unused argument `unpacker` of `ChunkMessagePackEventStreamer.each`
38
+ https://github.com/fluent/fluentd/pull/4159
39
+
40
+ ## Release v1.16.1 - 2023/04/17
41
+
42
+ ### Enhancement
43
+
44
+ * in_tcp: Add `message_length_limit` to drop large incoming data
45
+ https://github.com/fluent/fluentd/pull/4137
46
+
47
+ ### Bug Fix
48
+
49
+ * Fix NameError of `SecondaryFileOutput` when setting secondary other than
50
+ `out_secondary_file`
51
+ https://github.com/fluent/fluentd/pull/4124
52
+ * Server helper: Suppress error of `UDPServer` over `max_bytes` on Windows
53
+ https://github.com/fluent/fluentd/pull/4131
54
+ * Buffer: Fix that `compress` setting causes unexpected error when receiving
55
+ already compressed MessagePack
56
+ https://github.com/fluent/fluentd/pull/4147
57
+
58
+ ### Misc
59
+
60
+ * Update MAINTAINERS.md
61
+ https://github.com/fluent/fluentd/pull/4119
62
+ * Update security policy
63
+ https://github.com/fluent/fluentd/pull/4123
64
+ * Plugin template: Remove unnecessary code
65
+ https://github.com/fluent/fluentd/pull/4128
66
+ * Revive issue auto closer
67
+ https://github.com/fluent/fluentd/pull/4116
68
+ * Fix a link for the repository of td-agent
69
+ https://github.com/fluent/fluentd/pull/4145
70
+ * in_udp: add test of message_length_limit
71
+ https://github.com/fluent/fluentd/pull/4117
72
+ * Fix a typo of an argument of `Fluent::EventStream#each`
73
+ https://github.com/fluent/fluentd/pull/4148
74
+ * Test in_tcp: Fix undesirable way to assert logs
75
+ https://github.com/fluent/fluentd/pull/4138
76
+
77
+ ## Release v1.16.0 - 2023/03/29
78
+
79
+ ### Enhancement
80
+
81
+ * in_tcp: Add `send_keepalive_packet` option
82
+ https://github.com/fluent/fluentd/pull/3961
83
+ * buffer: backup broken file chunk
84
+ https://github.com/fluent/fluentd/pull/4025
85
+ * Add warning messages for restoring buffer with `flush_at_shutdown true`
86
+ https://github.com/fluent/fluentd/pull/4027
87
+ * Add logs for time period of restored buffer possibly broken
88
+ https://github.com/fluent/fluentd/pull/4028
89
+
90
+ ### Bug Fix
91
+
92
+ * http_server_helper: Fix format of log messages originating from Async gem
93
+ https://github.com/fluent/fluentd/pull/3987
94
+ * Change to not generate a sigdump file after receiving a `SIGTERM` signal on
95
+ non-Windows
96
+ https://github.com/fluent/fluentd/pull/4034
97
+ https://github.com/fluent/fluentd/pull/4043
98
+ * out_forward: fix error of ack handling conflict on stopping with
99
+ `require_ack_response` enabled
100
+ https://github.com/fluent/fluentd/pull/4030
101
+ * Fix problem that some `system` configs are not reflected
102
+ https://github.com/fluent/fluentd/pull/4064
103
+ https://github.com/fluent/fluentd/pull/4065
104
+ https://github.com/fluent/fluentd/pull/4086
105
+ https://github.com/fluent/fluentd/pull/4090
106
+ https://github.com/fluent/fluentd/pull/4096
107
+ * Fix bug that the logger outputs some initial log messages without applying
108
+ some settings such as `format`
109
+ https://github.com/fluent/fluentd/pull/4091
110
+ * Windows: Fix a bug that the wrong log file is reopened with log rotate setting
111
+ when flushing or graceful reloading
112
+ https://github.com/fluent/fluentd/pull/4054
113
+ * Fix race condition of out_secondary_file
114
+ https://github.com/fluent/fluentd/pull/4081
115
+ * Suppress warning using different secondary for out_secondary_file
116
+ https://github.com/fluent/fluentd/pull/4087
117
+ * Fix value of `system_config.workers` at `run_configure`.
118
+ Change argument type of `Fluent::Plugin::Base::configure()` to
119
+ `Fluent::Config::Element` only.
120
+ https://github.com/fluent/fluentd/pull/4066
121
+ * Fix bug that Fluentd sometimes tries to use an unavailable port and fails to
122
+ start on Windows
123
+ https://github.com/fluent/fluentd/pull/4092
124
+
125
+ ### Misc
126
+
127
+ * Add method for testing `filtered_with_time`
128
+ https://github.com/fluent/fluentd/pull/3899
129
+ * Replace `$$` with `Process.pid`
130
+ https://github.com/fluent/fluentd/pull/4040
131
+ * Relax required webric gem version
132
+ https://github.com/fluent/fluentd/pull/4061
133
+ * CI fixes to support Ruby 3.2
134
+ https://github.com/fluent/fluentd/pull/3968
135
+ https://github.com/fluent/fluentd/pull/3996
136
+ https://github.com/fluent/fluentd/pull/3997
137
+ * Other CI fixes
138
+ https://github.com/fluent/fluentd/pull/3969
139
+ https://github.com/fluent/fluentd/pull/3990
140
+ https://github.com/fluent/fluentd/pull/4013
141
+ https://github.com/fluent/fluentd/pull/4033
142
+ https://github.com/fluent/fluentd/pull/4044
143
+ https://github.com/fluent/fluentd/pull/4050
144
+ https://github.com/fluent/fluentd/pull/4062
145
+ https://github.com/fluent/fluentd/pull/4074
146
+ https://github.com/fluent/fluentd/pull/4082
147
+ https://github.com/fluent/fluentd/pull/4085
148
+ * Update MAINTAINERS.md
149
+ https://github.com/fluent/fluentd/pull/4026
150
+ https://github.com/fluent/fluentd/pull/4069
151
+
1
152
  # v1.15
2
153
 
3
154
  ## Release v1.15.3 - 2022/11/02
data/CONTRIBUTING.md CHANGED
@@ -27,7 +27,7 @@ submitting an issue to Fluentd. Even better you can submit a Pull Request with a
27
27
  * **Documentation**: Use [fluentd documentation](https://github.com/fluent/fluentd-docs-gitbook) repository.
28
28
 
29
29
  If you find a bug of 3rd party plugins, please submit an issue to each plugin repository.
30
- And use [omnibus-td-agent](https://github.com/treasure-data/omnibus-td-agent) repository for td-agent related issues.
30
+ And use [fluent-package-builder](https://github.com/fluent/fluent-package-builder) repository for td-agent related issues.
31
31
 
32
32
  Note: Before report the issue, check latest version first. Sometimes users report fixed bug with older version.
33
33
 
data/MAINTAINERS.md CHANGED
@@ -3,9 +3,11 @@
3
3
  - [Naotoshi Seo](https://github.com/sonots), [ZOZO Technologies](https://tech.zozo.com/en/)
4
4
  - [Okkez](https://github.com/okkez)
5
5
  - [Hiroshi Hatake](https://github.com/cosmo0920), [Calyptia](https://calyptia.com/)
6
- - [Masahiro Nakagawa](https://github.com/repeatedly), [Treasure Data](https://www.treasuredata.com/)
7
- - [Satoshi Tagomori](https://github.com/tagomoris), [Treasure Data](https://www.treasuredata.com/)
6
+ - [Masahiro Nakagawa](https://github.com/repeatedly)
7
+ - [Satoshi Tagomori](https://github.com/tagomoris)
8
+ - [Toru Takahashi](https://github.com/toru-takahashi), [Treasure Data](https://www.treasuredata.com/)
8
9
  - [Eduardo Silva](https://github.com/edsiper), [Calyptia](https://calyptia/)
9
- - [Fujimoto Seiji](https://github.com/fujimots), [ClearCode](https://www.clear-code.com/)
10
+ - [Fujimoto Seiji](https://github.com/fujimots)
10
11
  - [Takuro Ashie](https://github.com/ashie), [ClearCode](https://www.clear-code.com/)
11
12
  - [Kentaro Hayashi](https://github.com/kenhys), [ClearCode](https://www.clear-code.com/)
13
+ - [Daijiro Fukuda](https://github.com/daipom), [ClearCode](https://www.clear-code.com/)
data/README.md CHANGED
@@ -4,7 +4,6 @@ Fluentd: Open-Source Log Collector
4
4
  [![Testing on Ubuntu](https://github.com/fluent/fluentd/actions/workflows/linux-test.yaml/badge.svg?branch=master)](https://github.com/fluent/fluentd/actions/workflows/linux-test.yaml)
5
5
  [![Testing on Windows](https://github.com/fluent/fluentd/actions/workflows/windows-test.yaml/badge.svg?branch=master)](https://github.com/fluent/fluentd/actions/workflows/windows-test.yaml)
6
6
  [![Testing on macOS](https://github.com/fluent/fluentd/actions/workflows/macos-test.yaml/badge.svg?branch=master)](https://github.com/fluent/fluentd/actions/workflows/macos-test.yaml)
7
- [![Testing on Arm64](https://cloud.drone.io/api/badges/fluent/fluentd/status.svg?branch=master)](https://cloud.drone.io/fluent/fluentd)
8
7
  [![Code Climate](https://codeclimate.com/github/fluent/fluentd/badges/gpa.svg)](https://codeclimate.com/github/fluent/fluentd)
9
8
  [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1189/badge)](https://bestpractices.coreinfrastructure.org/projects/1189)
10
9
 
data/SECURITY.md CHANGED
@@ -4,15 +4,11 @@
4
4
 
5
5
  | Version | Supported |
6
6
  | ------- | ------------------ |
7
- | 1.14.x | :white_check_mark: |
8
- | <= 1.13.x | :x: |
7
+ | 1.16.x | :white_check_mark: |
8
+ | 1.15.x | :white_check_mark: |
9
+ | <= 1.14.x | :x: |
9
10
 
10
11
  ## Reporting a Vulnerability
11
12
 
12
- Please contact to current active maintainers. (in alphabetical order)
13
-
14
- * ashie@clear-code.com
15
- * fujimoto@clear-code.com
16
- * hatake@calyptia.com
17
- * hayashi@clear-code.com
18
-
13
+ Please post your vulnerability report from the following page:
14
+ https://github.com/fluent/fluentd/security/advisories
data/fluentd.gemspec CHANGED
@@ -22,13 +22,13 @@ Gem::Specification.new do |gem|
22
22
  gem.add_runtime_dependency("msgpack", [">= 1.3.1", "< 2.0.0"])
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
- gem.add_runtime_dependency("serverengine", [">= 2.3.0", "< 3.0.0"])
25
+ gem.add_runtime_dependency("serverengine", [">= 2.3.2", "< 3.0.0"])
26
26
  gem.add_runtime_dependency("http_parser.rb", [">= 0.5.1", "< 0.9.0"])
27
- gem.add_runtime_dependency("sigdump", ["~> 0.2.2"])
27
+ gem.add_runtime_dependency("sigdump", ["~> 0.2.5"])
28
28
  gem.add_runtime_dependency("tzinfo", [">= 1.0", "< 3.0"])
29
29
  gem.add_runtime_dependency("tzinfo-data", ["~> 1.0"])
30
30
  gem.add_runtime_dependency("strptime", [">= 0.2.4", "< 1.0.0"])
31
- gem.add_runtime_dependency("webrick", [">= 1.4.2", "< 1.8.0"])
31
+ gem.add_runtime_dependency("webrick", ["~> 1.4"])
32
32
 
33
33
  # build gem for a certain platform. see also Rakefile
34
34
  fake_platform = ENV['GEM_BUILD_FAKE_PLATFORM'].to_s
@@ -92,7 +92,7 @@ module Fluent
92
92
 
93
93
  def call
94
94
  if Fluent.windows?
95
- if @pid_or_svcname =~ /^[0-9]+$/
95
+ if /^[0-9]+$/.match?(@pid_or_svcname)
96
96
  # Use as PID
97
97
  return call_windows_event(@command, "fluentd_#{@pid_or_svcname}")
98
98
  end
@@ -172,7 +172,7 @@ module Fluent
172
172
  usage("PID or SVCNAME isn't specified!") if @pid_or_svcname.nil? || @pid_or_svcname.empty?
173
173
  else
174
174
  usage("PID isn't specified!") if @pid_or_svcname.nil? || @pid_or_svcname.empty?
175
- usage("Invalid PID: #{pid}") unless @pid_or_svcname =~ /^[0-9]+$/
175
+ usage("Invalid PID: #{pid}") unless /^[0-9]+$/.match?(@pid_or_svcname)
176
176
  end
177
177
  end
178
178
  end
@@ -26,26 +26,27 @@ $fluentdargv = Marshal.load(Marshal.dump(ARGV))
26
26
  op = OptionParser.new
27
27
  op.version = Fluent::VERSION
28
28
 
29
- opts = Fluent::Supervisor.default_options
29
+ default_opts = Fluent::Supervisor.default_options
30
+ cmd_opts = {}
30
31
 
31
32
  op.on('-s', "--setup [DIR=#{File.dirname(Fluent::DEFAULT_CONFIG_PATH)}]", "install sample configuration file to the directory") {|s|
32
- opts[:setup_path] = s || File.dirname(Fluent::DEFAULT_CONFIG_PATH)
33
+ cmd_opts[:setup_path] = s || File.dirname(Fluent::DEFAULT_CONFIG_PATH)
33
34
  }
34
35
 
35
36
  op.on('-c', '--config PATH', "config file path (default: #{Fluent::DEFAULT_CONFIG_PATH})") {|s|
36
- opts[:config_path] = s
37
+ cmd_opts[:config_path] = s
37
38
  }
38
39
 
39
40
  op.on('--dry-run', "Check fluentd setup is correct or not", TrueClass) {|b|
40
- opts[:dry_run] = b
41
+ cmd_opts[:dry_run] = b
41
42
  }
42
43
 
43
44
  op.on('--show-plugin-config=PLUGIN', "[DEPRECATED] Show PLUGIN configuration and exit(ex: input:dummy)") {|plugin|
44
- opts[:show_plugin_config] = plugin
45
+ cmd_opts[:show_plugin_config] = plugin
45
46
  }
46
47
 
47
48
  op.on('-p', '--plugin DIR', "add plugin directory") {|s|
48
- opts[:plugin_dirs] << s
49
+ (cmd_opts[:plugin_dirs] ||= []) << s
49
50
  }
50
51
 
51
52
  op.on('-I PATH', "add library path") {|s|
@@ -53,48 +54,48 @@ op.on('-I PATH', "add library path") {|s|
53
54
  }
54
55
 
55
56
  op.on('-r NAME', "load library") {|s|
56
- opts[:libs] << s
57
+ (cmd_opts[:libs] ||= []) << s
57
58
  }
58
59
 
59
60
  op.on('-d', '--daemon PIDFILE', "daemonize fluent process") {|s|
60
- opts[:daemonize] = s
61
+ cmd_opts[:daemonize] = s
61
62
  }
62
63
 
63
64
  op.on('--under-supervisor', "run fluent worker under supervisor (this option is NOT for users)") {
64
- opts[:supervise] = false
65
+ cmd_opts[:supervise] = false
65
66
  }
66
67
 
67
68
  op.on('--no-supervisor', "run fluent worker without supervisor") {
68
- opts[:supervise] = false
69
- opts[:standalone_worker] = true
69
+ cmd_opts[:supervise] = false
70
+ cmd_opts[:standalone_worker] = true
70
71
  }
71
72
 
72
73
  op.on('--workers NUM', "specify the number of workers under supervisor") { |i|
73
- opts[:workers] = i.to_i
74
+ cmd_opts[:workers] = i.to_i
74
75
  }
75
76
 
76
77
  op.on('--user USER', "change user") {|s|
77
- opts[:chuser] = s
78
+ cmd_opts[:chuser] = s
78
79
  }
79
80
 
80
81
  op.on('--group GROUP', "change group") {|s|
81
- opts[:chgroup] = s
82
+ cmd_opts[:chgroup] = s
82
83
  }
83
84
 
84
85
  op.on('--umask UMASK', "change umask") {|s|
85
- opts[:chumask] = s
86
+ cmd_opts[:chumask] = s
86
87
  }
87
88
 
88
89
  op.on('-o', '--log PATH', "log file path") {|s|
89
- opts[:log_path] = s
90
+ cmd_opts[:log_path] = s
90
91
  }
91
92
 
92
93
  op.on('--log-rotate-age AGE', 'generations to keep rotated log files') {|age|
93
94
  if Fluent::Log::LOG_ROTATE_AGE.include?(age)
94
- opts[:log_rotate_age] = age
95
+ cmd_opts[:log_rotate_age] = age
95
96
  else
96
97
  begin
97
- opts[:log_rotate_age] = Integer(age)
98
+ cmd_opts[:log_rotate_age] = Integer(age)
98
99
  rescue TypeError, ArgumentError
99
100
  usage "log-rotate-age should be #{ROTATE_AGE.join(', ')} or a number"
100
101
  end
@@ -102,129 +103,129 @@ op.on('--log-rotate-age AGE', 'generations to keep rotated log files') {|age|
102
103
  }
103
104
 
104
105
  op.on('--log-rotate-size BYTES', 'sets the byte size to rotate log files') {|s|
105
- opts[:log_rotate_size] = s.to_i
106
+ cmd_opts[:log_rotate_size] = s.to_i
106
107
  }
107
108
 
108
109
  op.on('--log-event-verbose', 'enable log events during process startup/shutdown') {|b|
109
- opts[:log_event_verbose] = b
110
+ cmd_opts[:log_event_verbose] = b
110
111
  }
111
112
 
112
113
  op.on('-i', '--inline-config CONFIG_STRING', "inline config which is appended to the config file on-the-fly") {|s|
113
- opts[:inline_config] = s
114
+ cmd_opts[:inline_config] = s
114
115
  }
115
116
 
116
117
  op.on('--emit-error-log-interval SECONDS', "suppress interval seconds of emit error logs") {|s|
117
- opts[:suppress_interval] = s.to_i
118
+ cmd_opts[:suppress_interval] = s.to_i
118
119
  }
119
120
 
120
121
  op.on('--suppress-repeated-stacktrace [VALUE]', "suppress repeated stacktrace", TrueClass) {|b|
121
122
  b = true if b.nil?
122
- opts[:suppress_repeated_stacktrace] = b
123
+ cmd_opts[:suppress_repeated_stacktrace] = b
123
124
  }
124
125
 
125
126
  op.on('--without-source', "invoke a fluentd without input plugins", TrueClass) {|b|
126
- opts[:without_source] = b
127
+ cmd_opts[:without_source] = b
127
128
  }
128
129
 
129
130
  op.on('--config-file-type VALU', 'guessing file type of fluentd configuration. yaml/yml or guess') { |s|
130
131
  if (s == 'yaml') || (s == 'yml')
131
- opts[:config_file_type] = s.to_sym
132
+ cmd_opts[:config_file_type] = s.to_sym
132
133
  elsif (s == 'guess')
133
- opts[:config_file_type] = s.to_sym
134
+ cmd_opts[:config_file_type] = s.to_sym
134
135
  else
135
136
  usage '--config-file-type accepts yaml/yml or guess'
136
137
  end
137
138
  }
138
139
 
139
140
  op.on('--use-v1-config', "Use v1 configuration format (default)", TrueClass) {|b|
140
- opts[:use_v1_config] = b
141
+ cmd_opts[:use_v1_config] = b
141
142
  }
142
143
 
143
144
  op.on('--use-v0-config', "Use v0 configuration format", TrueClass) {|b|
144
- opts[:use_v1_config] = !b
145
+ cmd_opts[:use_v1_config] = !b
145
146
  }
146
147
 
147
148
  op.on('--strict-config-value', "Parse config values strictly", TrueClass) {|b|
148
- opts[:strict_config_value] = b
149
+ cmd_opts[:strict_config_value] = b
149
150
  }
150
151
 
151
152
  op.on('--enable-input-metrics', "Enable input plugin metrics on fluentd", TrueClass) {|b|
152
- opts[:enable_input_metrics] = b
153
+ cmd_opts[:enable_input_metrics] = b
153
154
  }
154
155
 
155
156
  op.on('--enable-size-metrics', "Enable plugin record size metrics on fluentd", TrueClass) {|b|
156
- opts[:enable_size_metrics] = b
157
+ cmd_opts[:enable_size_metrics] = b
157
158
  }
158
159
 
159
160
  op.on('-v', '--verbose', "increase verbose level (-v: debug, -vv: trace)", TrueClass) {|b|
160
- if b
161
- opts[:log_level] = [opts[:log_level] - 1, Fluent::Log::LEVEL_TRACE].max
162
- end
161
+ return unless b
162
+ cur_level = cmd_opts.fetch(:log_level, default_opts[:log_level])
163
+ cmd_opts[:log_level] = [cur_level - 1, Fluent::Log::LEVEL_TRACE].max
163
164
  }
164
165
 
165
166
  op.on('-q', '--quiet', "decrease verbose level (-q: warn, -qq: error)", TrueClass) {|b|
166
- if b
167
- opts[:log_level] = [opts[:log_level] + 1, Fluent::Log::LEVEL_ERROR].min
168
- end
167
+ return unless b
168
+ cur_level = cmd_opts.fetch(:log_level, default_opts[:log_level])
169
+ cmd_opts[:log_level] = [cur_level + 1, Fluent::Log::LEVEL_ERROR].min
169
170
  }
170
171
 
171
172
  op.on('--suppress-config-dump', "suppress config dumping when fluentd starts", TrueClass) {|b|
172
- opts[:suppress_config_dump] = b
173
+ cmd_opts[:suppress_config_dump] = b
173
174
  }
174
175
 
175
176
  op.on('-g', '--gemfile GEMFILE', "Gemfile path") {|s|
176
- opts[:gemfile] = s
177
+ cmd_opts[:gemfile] = s
177
178
  }
178
179
 
179
180
  op.on('-G', '--gem-path GEM_INSTALL_PATH', "Gemfile install path (default: $(dirname $gemfile)/vendor/bundle)") {|s|
180
- opts[:gem_install_path] = s
181
+ cmd_opts[:gem_install_path] = s
181
182
  }
182
183
 
183
184
  op.on('--conf-encoding ENCODING', "specify configuration file encoding") { |s|
184
- opts[:conf_encoding] = s
185
+ cmd_opts[:conf_encoding] = s
185
186
  }
186
187
 
187
188
  op.on('--disable-shared-socket', "Don't open shared socket for multiple workers") { |b|
188
- opts[:disable_shared_socket] = b
189
+ cmd_opts[:disable_shared_socket] = b
189
190
  }
190
191
 
191
192
  if Fluent.windows?
192
- opts.merge!(
193
+ cmd_opts.merge!(
193
194
  :winsvc_name => 'fluentdwinsvc',
194
195
  :winsvc_display_name => 'Fluentd Windows Service',
195
196
  :winsvc_desc => 'Fluentd is an event collector system.',
196
197
  )
197
198
 
198
199
  op.on('-x', '--signame INTSIGNAME', "an object name which is used for Windows Service signal (Windows only)") {|s|
199
- opts[:signame] = s
200
+ cmd_opts[:signame] = s
200
201
  }
201
202
 
202
203
  op.on('--reg-winsvc MODE', "install/uninstall as Windows Service. (i: install, u: uninstall) (Windows only)") {|s|
203
- opts[:regwinsvc] = s
204
+ cmd_opts[:regwinsvc] = s
204
205
  }
205
206
 
206
207
  op.on('--[no-]reg-winsvc-auto-start', "Automatically start the Windows Service at boot. (only effective with '--reg-winsvc i') (Windows only)") {|s|
207
- opts[:regwinsvcautostart] = s
208
+ cmd_opts[:regwinsvcautostart] = s
208
209
  }
209
210
 
210
211
  op.on('--[no-]reg-winsvc-delay-start', "Automatically start the Windows Service at boot with delay. (only effective with '--reg-winsvc i' and '--reg-winsvc-auto-start') (Windows only)") {|s|
211
- opts[:regwinsvcdelaystart] = s
212
+ cmd_opts[:regwinsvcdelaystart] = s
212
213
  }
213
214
 
214
215
  op.on('--reg-winsvc-fluentdopt OPTION', "specify fluentd option parameters for Windows Service. (Windows only)") {|s|
215
- opts[:fluentdopt] = s
216
+ cmd_opts[:fluentdopt] = s
216
217
  }
217
218
 
218
219
  op.on('--winsvc-name NAME', "The Windows Service name to run as (Windows only)") {|s|
219
- opts[:winsvc_name] = s
220
+ cmd_opts[:winsvc_name] = s
220
221
  }
221
222
 
222
223
  op.on('--winsvc-display-name DISPLAY_NAME', "The Windows Service display name (Windows only)") {|s|
223
- opts[:winsvc_display_name] = s
224
+ cmd_opts[:winsvc_display_name] = s
224
225
  }
225
226
 
226
227
  op.on('--winsvc-desc DESC', "The Windows Service description (Windows only)") {|s|
227
- opts[:winsvc_desc] = s
228
+ cmd_opts[:winsvc_desc] = s
228
229
  }
229
230
  end
230
231
 
@@ -247,6 +248,7 @@ rescue
247
248
  usage $!.to_s
248
249
  end
249
250
 
251
+ opts = default_opts.merge(cmd_opts)
250
252
 
251
253
  ##
252
254
  ## Bundler injection
@@ -345,7 +347,7 @@ end
345
347
  exit 0 if early_exit
346
348
 
347
349
  if opts[:supervise]
348
- supervisor = Fluent::Supervisor.new(opts)
350
+ supervisor = Fluent::Supervisor.new(cmd_opts)
349
351
  supervisor.configure(supervisor: true)
350
352
  supervisor.run_supervisor(dry_run: opts[:dry_run])
351
353
  else
@@ -353,7 +355,7 @@ else
353
355
  puts "Error: multi workers is not supported with --no-supervisor"
354
356
  exit 2
355
357
  end
356
- worker = Fluent::Supervisor.new(opts)
358
+ worker = Fluent::Supervisor.new(cmd_opts)
357
359
  worker.configure
358
360
 
359
361
  if opts[:daemonize] && opts[:standalone_worker]
@@ -61,7 +61,7 @@ class FluentPluginConfigFormatter
61
61
  @plugin.class.ancestors.reverse_each do |plugin_class|
62
62
  next unless plugin_class.respond_to?(:dump_config_definition)
63
63
  unless @verbose
64
- next if plugin_class.name =~ /::PluginHelper::/
64
+ next if /::PluginHelper::/.match?(plugin_class.name)
65
65
  end
66
66
  dumped_config_definition = plugin_class.dump_config_definition
67
67
  dumped_config[plugin_class.name] = dumped_config_definition unless dumped_config_definition.empty?