fluentd 1.12.1 → 1.12.4
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/.deepsource.toml +13 -0
- data/.github/ISSUE_TEMPLATE/config.yml +2 -2
- data/.github/workflows/linux-test.yaml +36 -0
- data/.github/workflows/{build.yaml → macos-test.yaml} +8 -7
- data/.github/workflows/windows-test.yaml +35 -0
- data/.gitlab-ci.yml +41 -19
- data/CHANGELOG.md +95 -0
- data/MAINTAINERS.md +5 -2
- data/README.md +5 -2
- data/fluentd.gemspec +4 -2
- data/lib/fluent/command/bundler_injection.rb +1 -1
- data/lib/fluent/command/cat.rb +0 -1
- data/lib/fluent/command/plugin_config_formatter.rb +2 -1
- data/lib/fluent/command/plugin_generator.rb +31 -1
- data/lib/fluent/compat/parser.rb +2 -2
- data/lib/fluent/config/section.rb +1 -1
- data/lib/fluent/config/types.rb +2 -2
- data/lib/fluent/event.rb +3 -13
- data/lib/fluent/load.rb +0 -1
- data/lib/fluent/plugin/file_wrapper.rb +39 -3
- data/lib/fluent/plugin/formatter_ltsv.rb +2 -2
- data/lib/fluent/plugin/in_http.rb +1 -1
- data/lib/fluent/plugin/in_monitor_agent.rb +1 -1
- data/lib/fluent/plugin/in_tail/position_file.rb +15 -1
- data/lib/fluent/plugin/in_tail.rb +35 -15
- data/lib/fluent/plugin/out_copy.rb +18 -5
- data/lib/fluent/plugin/out_exec_filter.rb +3 -3
- data/lib/fluent/plugin/out_forward.rb +61 -28
- data/lib/fluent/plugin/output.rb +11 -9
- data/lib/fluent/plugin/parser_csv.rb +2 -2
- data/lib/fluent/plugin/parser_syslog.rb +2 -2
- data/lib/fluent/plugin/storage_local.rb +4 -4
- data/lib/fluent/plugin_helper/server.rb +4 -2
- data/lib/fluent/plugin_helper/socket_option.rb +2 -2
- data/lib/fluent/supervisor.rb +1 -1
- data/lib/fluent/time.rb +57 -1
- data/lib/fluent/version.rb +1 -1
- data/templates/new_gem/fluent-plugin.gemspec.erb +3 -3
- data/test/command/test_fluentd.rb +8 -0
- data/test/config/test_configurable.rb +1 -1
- data/test/plugin/in_tail/test_position_file.rb +58 -4
- data/test/plugin/test_file_wrapper.rb +105 -0
- data/test/plugin/test_in_exec.rb +1 -1
- data/test/plugin/test_in_tail.rb +87 -26
- data/test/plugin/test_out_copy.rb +87 -0
- data/test/plugin/test_out_forward.rb +94 -6
- data/test/plugin/test_out_http.rb +1 -1
- data/test/plugin/test_output.rb +15 -3
- data/test/plugin/test_output_as_buffered_backup.rb +2 -0
- data/test/plugin/test_parser_csv.rb +14 -0
- data/test/plugin/test_parser_syslog.rb +14 -0
- data/test/plugin_helper/service_discovery/test_manager.rb +1 -1
- data/test/plugin_helper/test_child_process.rb +5 -2
- data/test/plugin_helper/test_http_server_helper.rb +1 -1
- data/test/plugin_helper/test_server.rb +8 -2
- data/test/test_event.rb +16 -0
- data/test/test_formatter.rb +30 -0
- data/test/test_output.rb +2 -2
- data/test/test_time_parser.rb +109 -0
- metadata +31 -9
- data/.travis.yml +0 -77
- data/appveyor.yml +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18ac12d4a5dd93864521dae3a8a7db37fbe3bcd385f80a394bd6ddb34ffa6541
|
4
|
+
data.tar.gz: 105bc856fdf9863e414da2147d53a849d418f6ba6810888eab023d28e2097035
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16d72d0914ee5eb42ecb9e3957e791ddab88e1a32ed810785615470a0539eb01f0b91085167edac16937ec72b9352582ace8db3fc0adc06b64c3842111b16e3e
|
7
|
+
data.tar.gz: e928fc8ccaf35460e24b2157d95c3b2a076574fdd90801be94ff39fc86d92770f948425317aa8c1f192d826e190ce5e0abd5770bef922a8ed5e42c0494ca2c38
|
data/.deepsource.toml
ADDED
@@ -1,5 +1,5 @@
|
|
1
1
|
blank_issues_enabled: false
|
2
2
|
contact_links:
|
3
3
|
- name: Ask a Question
|
4
|
-
url: https://
|
5
|
-
about: I have questions about Fluentd and plugins. Please ask and answer questions
|
4
|
+
url: https://discuss.fluentd.org/
|
5
|
+
about: I have questions about Fluentd and plugins. Please ask and answer questions at https://discuss.fluentd.org/.
|
@@ -0,0 +1,36 @@
|
|
1
|
+
name: Testing on Ubuntu
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [master]
|
6
|
+
pull_request:
|
7
|
+
branches: [master]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ${{ matrix.os }}
|
12
|
+
continue-on-error: ${{ matrix.experimental }}
|
13
|
+
strategy:
|
14
|
+
fail-fast: false
|
15
|
+
matrix:
|
16
|
+
ruby-version: ['3.0', '2.7', '2.6', '2.5']
|
17
|
+
os: [ubuntu-latest]
|
18
|
+
experimental: [false]
|
19
|
+
include:
|
20
|
+
- ruby-version: head
|
21
|
+
os: ubuntu-latest
|
22
|
+
experimental: true
|
23
|
+
|
24
|
+
name: Unit testing with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
|
25
|
+
steps:
|
26
|
+
- uses: actions/checkout@v2
|
27
|
+
- name: Set up Ruby
|
28
|
+
uses: ruby/setup-ruby@v1
|
29
|
+
with:
|
30
|
+
ruby-version: ${{ matrix.ruby-version }}
|
31
|
+
- name: Install addons
|
32
|
+
run: sudo apt-get install libgmp3-dev libcap-ng-dev
|
33
|
+
- name: Install dependencies
|
34
|
+
run: bundle install
|
35
|
+
- name: Run tests
|
36
|
+
run: bundle exec rake test
|
@@ -1,4 +1,4 @@
|
|
1
|
-
name:
|
1
|
+
name: Testing on macOS
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
@@ -8,22 +8,23 @@ on:
|
|
8
8
|
|
9
9
|
jobs:
|
10
10
|
test:
|
11
|
-
runs-on:
|
12
|
-
|
11
|
+
runs-on: ${{ matrix.os }}
|
12
|
+
continue-on-error: ${{ matrix.experimental }}
|
13
13
|
strategy:
|
14
14
|
fail-fast: false
|
15
15
|
matrix:
|
16
|
-
ruby-version: [
|
16
|
+
ruby-version: ['head', '2.7']
|
17
|
+
os: [macos-latest]
|
18
|
+
experimental: [true]
|
17
19
|
|
20
|
+
name: Unit testing with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
|
18
21
|
steps:
|
19
22
|
- uses: actions/checkout@v2
|
20
23
|
- name: Set up Ruby
|
21
24
|
uses: ruby/setup-ruby@v1
|
22
25
|
with:
|
23
26
|
ruby-version: ${{ matrix.ruby-version }}
|
24
|
-
- name: Install addons
|
25
|
-
run: sudo apt-get install libgmp3-dev libcap-ng-dev
|
26
27
|
- name: Install dependencies
|
27
28
|
run: bundle install
|
28
29
|
- name: Run tests
|
29
|
-
run: bundle exec rake test
|
30
|
+
run: bundle exec rake test
|
@@ -0,0 +1,35 @@
|
|
1
|
+
name: Testing on Windows
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [master]
|
6
|
+
pull_request:
|
7
|
+
branches: [master]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ${{ matrix.os }}
|
12
|
+
continue-on-error: ${{ matrix.experimental }}
|
13
|
+
strategy:
|
14
|
+
fail-fast: false
|
15
|
+
matrix:
|
16
|
+
ruby-version: ['2.7', '2.6', '2.5']
|
17
|
+
os:
|
18
|
+
- windows-latest
|
19
|
+
experimental: [false]
|
20
|
+
include:
|
21
|
+
- ruby-version: '3.0'
|
22
|
+
os: windows-latest
|
23
|
+
experimental: true
|
24
|
+
|
25
|
+
name: Unit testing with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
|
26
|
+
steps:
|
27
|
+
- uses: actions/checkout@v2
|
28
|
+
- name: Set up Ruby
|
29
|
+
uses: ruby/setup-ruby@v1
|
30
|
+
with:
|
31
|
+
ruby-version: ${{ matrix.ruby-version }}
|
32
|
+
- name: Install dependencies
|
33
|
+
run: ridk exec bundle install
|
34
|
+
- name: Run tests
|
35
|
+
run: bundle exec rake test TESTOPTS=-v
|
data/.gitlab-ci.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
.install-template:
|
2
2
|
before_script:
|
3
|
-
- gem update --system
|
3
|
+
- gem update --system
|
4
4
|
- ruby -v
|
5
5
|
|
6
6
|
.test-template:
|
@@ -13,34 +13,44 @@ stages:
|
|
13
13
|
- build
|
14
14
|
- tests
|
15
15
|
|
16
|
-
2-
|
17
|
-
image: "ruby:2.
|
16
|
+
2-5-8:
|
17
|
+
image: "ruby:2.5.8"
|
18
18
|
stage: build
|
19
19
|
extends: .install-template
|
20
20
|
script:
|
21
21
|
- bundle install --jobs=3 --retry=3
|
22
22
|
cache:
|
23
|
-
key: "$CI_COMMIT_REF_SLUG 2-
|
23
|
+
key: "$CI_COMMIT_REF_SLUG 2-5-8"
|
24
24
|
paths:
|
25
25
|
|
26
|
-
2-
|
27
|
-
image: "ruby:2.
|
26
|
+
2-6-6:
|
27
|
+
image: "ruby:2.6.6"
|
28
28
|
stage: build
|
29
29
|
extends: .install-template
|
30
30
|
script:
|
31
31
|
- bundle install --jobs=3 --retry=3
|
32
32
|
cache:
|
33
|
-
key: "$CI_COMMIT_REF_SLUG 2-
|
33
|
+
key: "$CI_COMMIT_REF_SLUG 2-6-6"
|
34
34
|
paths:
|
35
35
|
|
36
|
-
2-
|
37
|
-
image: "ruby:2.
|
36
|
+
2-7-2:
|
37
|
+
image: "ruby:2.7.2"
|
38
38
|
stage: build
|
39
39
|
extends: .install-template
|
40
40
|
script:
|
41
41
|
- bundle install --jobs=3 --retry=3
|
42
42
|
cache:
|
43
|
-
key: "$CI_COMMIT_REF_SLUG 2-
|
43
|
+
key: "$CI_COMMIT_REF_SLUG 2-7-2"
|
44
|
+
paths:
|
45
|
+
|
46
|
+
3-0-0:
|
47
|
+
image: "ruby:3.0.0"
|
48
|
+
stage: build
|
49
|
+
extends: .install-template
|
50
|
+
script:
|
51
|
+
- bundle install --jobs=3 --retry=3
|
52
|
+
cache:
|
53
|
+
key: "$CI_COMMIT_REF_SLUG 3-0-0"
|
44
54
|
paths:
|
45
55
|
|
46
56
|
rubyhead:
|
@@ -54,39 +64,51 @@ rubyhead:
|
|
54
64
|
paths:
|
55
65
|
- ./*
|
56
66
|
|
57
|
-
2-
|
58
|
-
image: "ruby:2.
|
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
|
+
2-6-6-test:
|
80
|
+
image: "ruby:2.6.6"
|
59
81
|
stage: tests
|
60
82
|
allow_failure: true
|
61
83
|
extends: .test-template
|
62
84
|
script:
|
63
85
|
- bundle exec rake test
|
64
86
|
cache:
|
65
|
-
key: "$CI_COMMIT_REF_SLUG 2-
|
87
|
+
key: "$CI_COMMIT_REF_SLUG 2-6-6"
|
66
88
|
paths:
|
67
89
|
- ./*
|
68
90
|
|
69
|
-
2-
|
70
|
-
image: "ruby:2.
|
91
|
+
2-7-2-test:
|
92
|
+
image: "ruby:2.7.2"
|
71
93
|
stage: tests
|
72
94
|
allow_failure: true
|
73
95
|
extends: .test-template
|
74
96
|
script:
|
75
97
|
- bundle exec rake test
|
76
98
|
cache:
|
77
|
-
key: "$CI_COMMIT_REF_SLUG 2-
|
99
|
+
key: "$CI_COMMIT_REF_SLUG 2-7-2"
|
78
100
|
paths:
|
79
101
|
- ./*
|
80
102
|
|
81
|
-
|
82
|
-
image: "ruby:
|
103
|
+
3-0-0-test:
|
104
|
+
image: "ruby:3.0.0"
|
83
105
|
stage: tests
|
84
106
|
allow_failure: true
|
85
107
|
extends: .test-template
|
86
108
|
script:
|
87
109
|
- bundle exec rake test
|
88
110
|
cache:
|
89
|
-
key: "$CI_COMMIT_REF_SLUG
|
111
|
+
key: "$CI_COMMIT_REF_SLUG 3-0-0"
|
90
112
|
paths:
|
91
113
|
- ./*
|
92
114
|
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,100 @@
|
|
1
1
|
# v1.12
|
2
2
|
|
3
|
+
## Release v1.12.4 - 2021/05/26
|
4
|
+
|
5
|
+
### Bug fix
|
6
|
+
|
7
|
+
* in_tail: Fix a bug that refresh_watcher fails to handle file rotations
|
8
|
+
|
9
|
+
## Release v1.12.3 - 2021/04/23
|
10
|
+
|
11
|
+
### Enhancement
|
12
|
+
|
13
|
+
* plugin_helper: Allow TLS to use keep-alive socket option
|
14
|
+
https://github.com/fluent/fluentd/pull/3308
|
15
|
+
|
16
|
+
### Bug fix
|
17
|
+
|
18
|
+
* parser_csv, parser_syslog: Fix a naming conflict on parser_type
|
19
|
+
https://github.com/fluent/fluentd/pull/3302
|
20
|
+
* in_tail: Fix incorrect error code & message on Windows
|
21
|
+
https://github.com/fluent/fluentd/pull/3325
|
22
|
+
https://github.com/fluent/fluentd/pull/3329
|
23
|
+
https://github.com/fluent/fluentd/pull/3331
|
24
|
+
https://github.com/fluent/fluentd/pull/3337
|
25
|
+
* in_tail: Fix a crash bug on catching a short-lived log
|
26
|
+
https://github.com/fluent/fluentd/pull/3328
|
27
|
+
* storage_local: Fix position file corruption issue on concurrent gracefulReloads
|
28
|
+
https://github.com/fluent/fluentd/pull/3335
|
29
|
+
* Fix incorrect warnings about ${chunk_id} with out_s3
|
30
|
+
https://github.com/fluent/fluentd/pull/3339
|
31
|
+
* TLS Server: Add peer information to error log message
|
32
|
+
https://github.com/fluent/fluentd/pull/3330
|
33
|
+
|
34
|
+
### Misc
|
35
|
+
|
36
|
+
* fluent-plugin-generate: add note about plugin name
|
37
|
+
https://github.com/fluent/fluentd/pull/3303
|
38
|
+
* fluent-plugin-generate: Use same depended gem version with fluentd
|
39
|
+
https://github.com/fluent/fluentd/pull/3305
|
40
|
+
* Fix some broken unit tests and improve CI's stability
|
41
|
+
https://github.com/fluent/fluentd/pull/3304
|
42
|
+
https://github.com/fluent/fluentd/pull/3307
|
43
|
+
https://github.com/fluent/fluentd/pull/3312
|
44
|
+
https://github.com/fluent/fluentd/pull/3313
|
45
|
+
https://github.com/fluent/fluentd/pull/3314
|
46
|
+
https://github.com/fluent/fluentd/pull/3316
|
47
|
+
https://github.com/fluent/fluentd/pull/3336
|
48
|
+
* Permit to install with win32-service 2.2.0 on Windows
|
49
|
+
https://github.com/fluent/fluentd/pull/3343
|
50
|
+
|
51
|
+
## Release v1.12.2 - 2021/03/29
|
52
|
+
|
53
|
+
### Enhancement
|
54
|
+
|
55
|
+
* out_copy: Add ignore_if_prev_successes
|
56
|
+
https://github.com/fluent/fluentd/pull/3190
|
57
|
+
https://github.com/fluent/fluentd/pull/3287
|
58
|
+
* Support multiple kind of timestamp format
|
59
|
+
https://github.com/fluent/fluentd/pull/3252
|
60
|
+
* formatter_ltsv: suppress delimiters in output
|
61
|
+
https://github.com/fluent/fluentd/pull/1666
|
62
|
+
https://github.com/fluent/fluentd/pull/3288
|
63
|
+
https://github.com/fluent/fluentd/pull/3289
|
64
|
+
|
65
|
+
### Bug fix
|
66
|
+
|
67
|
+
* in_tail: Expect ENOENT during stat
|
68
|
+
https://github.com/fluent/fluentd/pull/3275
|
69
|
+
* out_forward: Prevent transferring duplicate logs on restart
|
70
|
+
https://github.com/fluent/fluentd/pull/3267
|
71
|
+
https://github.com/fluent/fluentd/pull/3285
|
72
|
+
* in_tail: Handle to send rotated logs when mv is used for rotating
|
73
|
+
https://github.com/fluent/fluentd/pull/3294
|
74
|
+
* fluent-plugin-config-format: Fill an uninitialized instance variable
|
75
|
+
https://github.com/fluent/fluentd/pull/3297
|
76
|
+
* Fix MessagePackEventStream issue with Enumerable methods
|
77
|
+
https://github.com/fluent/fluentd/pull/2116
|
78
|
+
|
79
|
+
### Misc
|
80
|
+
|
81
|
+
* Add webrick to support Ruby 3.0
|
82
|
+
https://github.com/fluent/fluentd/pull/3257
|
83
|
+
* Suggest Discource instead of Google Groups
|
84
|
+
https://github.com/fluent/fluentd/pull/3261
|
85
|
+
* Update MAINTAINERS.md
|
86
|
+
https://github.com/fluent/fluentd/pull/3282
|
87
|
+
* Introduce DeepSource to check code quality
|
88
|
+
https://github.com/fluent/fluentd/pull/3286
|
89
|
+
https://github.com/fluent/fluentd/pull/3259
|
90
|
+
https://github.com/fluent/fluentd/pull/3291
|
91
|
+
* Migrate to GitHub Actions and stabilize tests
|
92
|
+
https://github.com/fluent/fluentd/pull/3266
|
93
|
+
https://github.com/fluent/fluentd/pull/3268
|
94
|
+
https://github.com/fluent/fluentd/pull/3281
|
95
|
+
https://github.com/fluent/fluentd/pull/3283
|
96
|
+
https://github.com/fluent/fluentd/pull/3290
|
97
|
+
|
3
98
|
## Release v1.12.1 - 2021/02/18
|
4
99
|
|
5
100
|
### Enhancement
|
data/MAINTAINERS.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
# Fluentd Maintainers
|
2
2
|
|
3
3
|
- [Naotoshi Seo](https://github.com/sonots), [ZOZO Technologies](https://tech.zozo.com/en/)
|
4
|
-
- [Okkez](https://github.com/okkez)
|
5
|
-
- [Hiroshi Hatake](https://github.com/cosmo0920), [
|
4
|
+
- [Okkez](https://github.com/okkez)
|
5
|
+
- [Hiroshi Hatake](https://github.com/cosmo0920), [ClearCode](https://www.clear-code.com/)
|
6
6
|
- [Masahiro Nakagawa](https://github.com/repeatedly), [Treasure Data](https://www.treasuredata.com/)
|
7
7
|
- [Satoshi Tagomori](https://github.com/tagomoris), [Treasure Data](https://www.treasuredata.com/)
|
8
8
|
- [Eduardo Silva](https://github.com/edsiper), [Arm Treasure Data](https://www.treasuredata.com/)
|
9
|
+
- [Fujimoto Seiji](https://github.com/fujimots), [ClearCode](https://www.clear-code.com/)
|
10
|
+
- [Takuro Ashie](https://github.com/ashie), [ClearCode](https://www.clear-code.com/)
|
11
|
+
- [Kentaro Hayashi](https://github.com/kenhys), [ClearCode](https://www.clear-code.com/)
|
data/README.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
Fluentd: Open-Source Log Collector
|
2
2
|
===================================
|
3
|
-
|
3
|
+
GitHub Actions:
|
4
4
|
|
5
|
-
[
|
5
|
+
[![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)
|
6
|
+
[![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)
|
7
|
+
[![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)
|
8
|
+
[![Code Climate](https://codeclimate.com/github/fluent/fluentd/badges/gpa.svg)](https://codeclimate.com/github/fluent/fluentd)
|
6
9
|
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1189/badge)](https://bestpractices.coreinfrastructure.org/projects/1189)
|
7
10
|
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Ffluent%2Ffluentd.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Ffluent%2Ffluentd?ref=badge_shield)
|
8
11
|
|
data/fluentd.gemspec
CHANGED
@@ -28,12 +28,14 @@ Gem::Specification.new do |gem|
|
|
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.2", "< 1.0.0"])
|
31
|
+
gem.add_runtime_dependency("webrick", [">= 1.4.2", "< 1.8.0"])
|
31
32
|
|
32
33
|
# build gem for a certain platform. see also Rakefile
|
33
34
|
fake_platform = ENV['GEM_BUILD_FAKE_PLATFORM'].to_s
|
34
35
|
gem.platform = fake_platform unless fake_platform.empty?
|
35
36
|
if /mswin|mingw/ =~ fake_platform || (/mswin|mingw/ =~ RUBY_PLATFORM && fake_platform.empty?)
|
36
|
-
gem.add_runtime_dependency("win32-
|
37
|
+
gem.add_runtime_dependency("win32-api", [">= 1.10", "< 2.0.0"])
|
38
|
+
gem.add_runtime_dependency("win32-service", ["~> 2.2.0"])
|
37
39
|
gem.add_runtime_dependency("win32-ipc", ["~> 0.7.0"])
|
38
40
|
gem.add_runtime_dependency("win32-event", ["~> 0.6.3"])
|
39
41
|
gem.add_runtime_dependency("windows-pr", ["~> 1.2.6"])
|
@@ -44,7 +46,7 @@ Gem::Specification.new do |gem|
|
|
44
46
|
gem.add_development_dependency("flexmock", ["~> 2.0"])
|
45
47
|
gem.add_development_dependency("parallel_tests", ["~> 0.15.3"])
|
46
48
|
gem.add_development_dependency("simplecov", ["~> 0.7"])
|
47
|
-
gem.add_development_dependency("rr", ["~>
|
49
|
+
gem.add_development_dependency("rr", ["~> 3.0"])
|
48
50
|
gem.add_development_dependency("timecop", ["~> 0.9"])
|
49
51
|
gem.add_development_dependency("test-unit", ["~> 3.3"])
|
50
52
|
gem.add_development_dependency("test-unit-rr", ["~> 1.0"])
|
data/lib/fluent/command/cat.rb
CHANGED
@@ -44,6 +44,7 @@ class FluentPluginConfigFormatter
|
|
44
44
|
@verbose = false
|
45
45
|
@libs = []
|
46
46
|
@plugin_dirs = []
|
47
|
+
@table = false
|
47
48
|
@options = {}
|
48
49
|
|
49
50
|
prepare_option_parser
|
@@ -162,7 +163,7 @@ class FluentPluginConfigFormatter
|
|
162
163
|
else
|
163
164
|
sections, params = base_section.partition {|_name, value| value[:section] }
|
164
165
|
end
|
165
|
-
if @table
|
166
|
+
if @table && (not params.empty?)
|
166
167
|
dumped << "### Configuration\n\n"
|
167
168
|
dumped << "|parameter|type|description|default|\n"
|
168
169
|
dumped << "|---|---|---|---|\n"
|
@@ -105,7 +105,7 @@ Generate a project skeleton for creating a Fluentd plugin
|
|
105
105
|
|
106
106
|
Arguments:
|
107
107
|
\ttype: #{SUPPORTED_TYPES.join(",")}
|
108
|
-
\tname: Your plugin name
|
108
|
+
\tname: Your plugin name (fluent-plugin- prefix will be added to <name>)
|
109
109
|
|
110
110
|
Options:
|
111
111
|
BANNER
|
@@ -151,6 +151,36 @@ BANNER
|
|
151
151
|
underscore_name
|
152
152
|
end
|
153
153
|
|
154
|
+
def gem_file_path
|
155
|
+
File.expand_path(File.join(File.dirname(__FILE__),
|
156
|
+
"../../../",
|
157
|
+
"Gemfile"))
|
158
|
+
end
|
159
|
+
|
160
|
+
def lock_file_path
|
161
|
+
File.expand_path(File.join(File.dirname(__FILE__),
|
162
|
+
"../../../",
|
163
|
+
"Gemfile.lock"))
|
164
|
+
end
|
165
|
+
|
166
|
+
def locked_gem_version(gem_name)
|
167
|
+
d = Bundler::Definition.build(gem_file_path, lock_file_path, false)
|
168
|
+
d.locked_gems.dependencies[gem_name].requirement.requirements.first.last.version
|
169
|
+
end
|
170
|
+
|
171
|
+
def rake_version
|
172
|
+
locked_gem_version("rake")
|
173
|
+
end
|
174
|
+
|
175
|
+
def test_unit_version
|
176
|
+
locked_gem_version("test-unit")
|
177
|
+
end
|
178
|
+
|
179
|
+
def bundler_version
|
180
|
+
d = Bundler::Definition.build(gem_file_path, lock_file_path, false)
|
181
|
+
d.locked_gems.bundler_version.version
|
182
|
+
end
|
183
|
+
|
154
184
|
def class_name
|
155
185
|
"#{capitalized_name}#{type.capitalize}"
|
156
186
|
end
|
data/lib/fluent/compat/parser.rb
CHANGED
@@ -244,10 +244,10 @@ module Fluent
|
|
244
244
|
end
|
245
245
|
|
246
246
|
def convert_value_to_nil(value)
|
247
|
-
if value
|
247
|
+
if value && @null_empty_string
|
248
248
|
value = (value == '') ? nil : value
|
249
249
|
end
|
250
|
-
if value
|
250
|
+
if value && @null_value_pattern
|
251
251
|
value = ::Fluent::StringUtil.match_regexp(@null_value_pattern, value) ? nil : value
|
252
252
|
end
|
253
253
|
value
|
@@ -179,7 +179,7 @@ module Fluent
|
|
179
179
|
end
|
180
180
|
|
181
181
|
if section_params[varname].nil?
|
182
|
-
unless proxy.defaults.has_key?(varname)
|
182
|
+
unless proxy.defaults.has_key?(varname) && proxy.defaults[varname].nil?
|
183
183
|
logger.error "config error in:\n#{conf}" if logger
|
184
184
|
raise ConfigError, "'#{name}' parameter is required but nil is specified"
|
185
185
|
end
|
data/lib/fluent/config/types.rb
CHANGED
@@ -186,7 +186,7 @@ module Fluent
|
|
186
186
|
return nil if val.nil?
|
187
187
|
|
188
188
|
param = if val.is_a?(String)
|
189
|
-
val.start_with?('{') ? JSON.
|
189
|
+
val.start_with?('{') ? JSON.parse(val) : Hash[val.strip.split(/\s*,\s*/).map{|v| v.split(':', 2)}]
|
190
190
|
else
|
191
191
|
val
|
192
192
|
end
|
@@ -213,7 +213,7 @@ module Fluent
|
|
213
213
|
return nil if val.nil?
|
214
214
|
|
215
215
|
param = if val.is_a?(String)
|
216
|
-
val.start_with?('[') ? JSON.
|
216
|
+
val.start_with?('[') ? JSON.parse(val) : val.strip.split(/\s*,\s*/)
|
217
217
|
else
|
218
218
|
val
|
219
219
|
end
|
data/lib/fluent/event.rb
CHANGED
@@ -254,19 +254,9 @@ module Fluent
|
|
254
254
|
end
|
255
255
|
|
256
256
|
def each(unpacker: nil, &block)
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
end
|
261
|
-
else
|
262
|
-
@unpacked_times = []
|
263
|
-
@unpacked_records = []
|
264
|
-
(unpacker || Fluent::MessagePackFactory.msgpack_unpacker).feed_each(@data) do |time, record|
|
265
|
-
@unpacked_times << time
|
266
|
-
@unpacked_records << record
|
267
|
-
block.call(time, record)
|
268
|
-
end
|
269
|
-
@size = @unpacked_times.size
|
257
|
+
ensure_unpacked!(unpacker: unpacker)
|
258
|
+
@unpacked_times.each_with_index do |time, i|
|
259
|
+
block.call(time, @unpacked_records[i])
|
270
260
|
end
|
271
261
|
nil
|
272
262
|
end
|
data/lib/fluent/load.rb
CHANGED
@@ -46,6 +46,42 @@ module Fluent
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
+
class Win32Error < StandardError
|
50
|
+
require 'windows/error'
|
51
|
+
include Windows::Error
|
52
|
+
|
53
|
+
attr_reader :errcode, :msg
|
54
|
+
|
55
|
+
def initialize(errcode, msg = nil)
|
56
|
+
@errcode = errcode
|
57
|
+
@msg = msg
|
58
|
+
end
|
59
|
+
|
60
|
+
def format_english_message(errcode)
|
61
|
+
buf = 0.chr * 260
|
62
|
+
flags = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY
|
63
|
+
english_lang_id = 1033 # The result of MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)
|
64
|
+
FormatMessageA.call(flags, 0, errcode, english_lang_id, buf, buf.size, 0)
|
65
|
+
buf.force_encoding(Encoding.default_external).strip
|
66
|
+
end
|
67
|
+
|
68
|
+
def to_s
|
69
|
+
msg = super
|
70
|
+
msg << ": code: #{@errcode}, #{format_english_message(@errcode)}"
|
71
|
+
msg << " - #{@msg}" if @msg
|
72
|
+
msg
|
73
|
+
end
|
74
|
+
|
75
|
+
def inspect
|
76
|
+
"#<#{to_s}>"
|
77
|
+
end
|
78
|
+
|
79
|
+
def ==(other)
|
80
|
+
return false if other.class != Win32Error
|
81
|
+
@errcode == other.errcode && @msg == other.msg
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
49
85
|
# To open and get stat with setting FILE_SHARE_DELETE
|
50
86
|
class WindowsFile
|
51
87
|
require 'windows/file'
|
@@ -77,11 +113,11 @@ module Fluent
|
|
77
113
|
@file_handle = CreateFile.call(@path, access, sharemode,
|
78
114
|
0, creationdisposition, FILE_ATTRIBUTE_NORMAL, 0)
|
79
115
|
if @file_handle == INVALID_HANDLE_VALUE
|
80
|
-
err =
|
116
|
+
err = Win32::API.last_error
|
81
117
|
if err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND || err == ERROR_ACCESS_DENIED
|
82
|
-
raise
|
118
|
+
raise Errno::ENOENT
|
83
119
|
end
|
84
|
-
raise
|
120
|
+
raise Win32Error.new(err, path)
|
85
121
|
end
|
86
122
|
end
|
87
123
|
|
@@ -27,14 +27,14 @@ module Fluent
|
|
27
27
|
|
28
28
|
config_param :delimiter, :string, default: "\t".freeze
|
29
29
|
config_param :label_delimiter, :string, default: ":".freeze
|
30
|
+
config_param :replacement, :string, default: " ".freeze
|
30
31
|
config_param :add_newline, :bool, default: true
|
31
32
|
|
32
|
-
# TODO: escaping for \t in values
|
33
33
|
def format(tag, time, record)
|
34
34
|
formatted = ""
|
35
35
|
record.each do |label, value|
|
36
36
|
formatted << @delimiter if formatted.length.nonzero?
|
37
|
-
formatted << "#{label}#{@label_delimiter}#{value}"
|
37
|
+
formatted << "#{label}#{@label_delimiter}#{value.to_s.gsub(@delimiter, @replacement)}"
|
38
38
|
end
|
39
39
|
formatted << @newline if @add_newline
|
40
40
|
formatted
|
@@ -503,7 +503,7 @@ module Fluent::Plugin
|
|
503
503
|
# For every incoming request, we check if we have some CORS
|
504
504
|
# restrictions and allow listed origins through @cors_allow_origins.
|
505
505
|
unless @cors_allow_origins.nil?
|
506
|
-
unless @cors_allow_origins.include?('*')
|
506
|
+
unless @cors_allow_origins.include?('*') || include_cors_allow_origin
|
507
507
|
send_response_and_close(RES_403_STATUS, {'Connection' => 'close'}, "")
|
508
508
|
return
|
509
509
|
end
|