fluent-plugin-cat-sweep 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +10 -2
- data/CHANGELOG.md +7 -0
- data/README.md +78 -9
- data/fluent-plugin-cat-sweep.gemspec +1 -1
- data/gemfiles/Gemfile.fluentd.0.14 +4 -0
- data/lib/fluent/plugin/in_cat_sweep.rb +1 -0
- data/test/test_in_cat_sweep.rb +2 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 544f11f87dd14ada6a99e6bf6c8e8afb91c815c3
|
4
|
+
data.tar.gz: a8738fa50b24923cf7594ea3d30a45e1c1c5435b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8c2d5ffb0b448fc28e84910387f888c578fbcee264b5fd3bdc32132998a01e4ee35bc4c0741a850e0a8518cc91e98b5b5aebdb806858c62822f339c5711e1a1
|
7
|
+
data.tar.gz: b0840fb54a3957463bb21243e5f84974514e9024d57f1b6570aa9bdf32dca000e24573aaa00e0128dfa6a139f79f07c0b3ebe0462141eccb99dc5476ff9d0676
|
data/.travis.yml
CHANGED
@@ -1,10 +1,18 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 1.9.3
|
4
|
-
- 2.0.0
|
5
3
|
- 2.1.*
|
6
4
|
- 2.2.*
|
5
|
+
- '2.3'
|
6
|
+
- '2.4'
|
7
7
|
gemfile:
|
8
|
+
- gemfiles/Gemfile.fluentd.0.14
|
8
9
|
- gemfiles/Gemfile.fluentd.0.12
|
9
10
|
- gemfiles/Gemfile.fluentd.0.10
|
10
11
|
- gemfiles/Gemfile.fluentd.0.10.45
|
12
|
+
|
13
|
+
matrix:
|
14
|
+
exclude:
|
15
|
+
- rvm: '2.4'
|
16
|
+
gemfile: gemfiles/Gemfile.fluentd.0.10
|
17
|
+
- rvm: '2.4'
|
18
|
+
gemfile: gemfiles/Gemfile.fluentd.0.10.45
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -37,6 +37,76 @@ This plugin watches the directory (`file_path_with_glob tmp/test/access.log.*`),
|
|
37
37
|
|
38
38
|
Our assumption is that this mechanism should provide more durability than `in_tail` (batch read overcomes than streaming read).
|
39
39
|
|
40
|
+
## Potential problem of in_tail
|
41
|
+
|
42
|
+
Assume that an application outputs logs into `/tmp/test/access.log` and rotates it in every one minute interval as
|
43
|
+
|
44
|
+
(initial state)
|
45
|
+
|
46
|
+
```
|
47
|
+
tmp/test
|
48
|
+
└── accesss.log (i-node 4478316)
|
49
|
+
```
|
50
|
+
|
51
|
+
(one minute later)
|
52
|
+
|
53
|
+
```
|
54
|
+
tmp/test
|
55
|
+
├── accesss.log (i-node 4478319)
|
56
|
+
└── accesss.log.1 (i-node 4478316)
|
57
|
+
```
|
58
|
+
|
59
|
+
(two minutes later)
|
60
|
+
|
61
|
+
```
|
62
|
+
tmp/test
|
63
|
+
├── accesss.log (i-node 4478322)
|
64
|
+
├── accesss.log.1 (i-node 4478319)
|
65
|
+
└── accesss.log.2 (i-node 4478316)
|
66
|
+
```
|
67
|
+
|
68
|
+
Your configuration of `in_tail` may become as followings:
|
69
|
+
|
70
|
+
```apache
|
71
|
+
<source>
|
72
|
+
@type tail
|
73
|
+
path tmp/test/access.log
|
74
|
+
pos_file /var/log/td-agent/access.log.pos
|
75
|
+
tag access
|
76
|
+
format none
|
77
|
+
</source>
|
78
|
+
```
|
79
|
+
|
80
|
+
Now, imagine that the fluentd process dies (or manually stops for maintenance) just before the 2nd file of i-node 4478319 is generated, and you restart the fluentd process after two minutes passed. Then, you miss the 2nd file of i-node 4478319.
|
81
|
+
|
82
|
+
(initial state)
|
83
|
+
|
84
|
+
```
|
85
|
+
tmp/test
|
86
|
+
└── accesss.log (i-node 4478316) <= catch
|
87
|
+
```
|
88
|
+
|
89
|
+
(fluentd dies)
|
90
|
+
|
91
|
+
(one minute later)
|
92
|
+
|
93
|
+
```
|
94
|
+
tmp/test
|
95
|
+
├── accesss.log (i-node 4478319) <= miss
|
96
|
+
└── accesss.log.1 (i-node 4478316)
|
97
|
+
```
|
98
|
+
|
99
|
+
(two minutes later)
|
100
|
+
|
101
|
+
(fluentd restarts)
|
102
|
+
|
103
|
+
```
|
104
|
+
tmp/test
|
105
|
+
├── accesss.log (i-node 4478322) <= catch
|
106
|
+
├── accesss.log.1 (i-node 4478319) <= miss
|
107
|
+
└── accesss.log.2 (i-node 4478316)
|
108
|
+
```
|
109
|
+
|
40
110
|
## Configuration
|
41
111
|
|
42
112
|
```
|
@@ -51,31 +121,31 @@ Our assumption is that this mechanism should provide more durability than `in_ta
|
|
51
121
|
keys xpath,access_time,label,payload
|
52
122
|
|
53
123
|
# Required. process files that are older than this parameter(seconds).
|
54
|
-
# [WARNING!!]: this plugin
|
55
|
-
#
|
124
|
+
# [WARNING!!]: this plugin moves or removes files even if the files are still open.
|
125
|
+
# make sure to set this parameter for seconds that the application closes files definitely.
|
56
126
|
waiting_seconds 60
|
57
127
|
|
58
128
|
# Optional. default is file.cat_sweep
|
59
129
|
tag test.input
|
60
130
|
|
61
|
-
# Optional. processing files
|
131
|
+
# Optional. processing files are renamed with this suffix. default is .processing
|
62
132
|
processing_file_suffix .processing
|
63
133
|
|
64
|
-
# Optional. error files
|
134
|
+
# Optional. error files are renamed with this suffix. default is .error
|
65
135
|
error_file_suffix .err
|
66
136
|
|
67
137
|
# Optional. line terminater. default is "\n"
|
68
138
|
line_terminated_by ,
|
69
139
|
|
70
|
-
# Optional. max bytes oneline can
|
140
|
+
# Optional. max bytes oneline can have. default 536870912 (512MB)
|
71
141
|
oneline_max_bytes 128000
|
72
142
|
|
73
|
-
# Optional. processed files are
|
143
|
+
# Optional. processed files are moved to this directory.
|
74
144
|
# default '/tmp'
|
75
145
|
move_to /tmp/test_processed
|
76
146
|
|
77
|
-
# Optional. this parameter
|
78
|
-
# files
|
147
|
+
# Optional. if this parameter is specified, `move_to` option is ignored.
|
148
|
+
# processed files are removed instead of being moved to `move_to` directory.
|
79
149
|
# default is false.
|
80
150
|
remove_after_processing true
|
81
151
|
|
@@ -97,7 +167,6 @@ Our assumption is that this mechanism should provide more durability than `in_ta
|
|
97
167
|
|
98
168
|
* This plugin supports fluentd from v0.10.45
|
99
169
|
* The support for fluentd v0.10 will end near future
|
100
|
-
* The support for fluentd v0.14 is not yet
|
101
170
|
|
102
171
|
## Contributing
|
103
172
|
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "fluent-plugin-cat-sweep"
|
7
|
-
spec.version = "0.1.
|
7
|
+
spec.version = "0.1.4"
|
8
8
|
spec.authors = ["Civitaspo(takahiro.nakayama)", "Naotoshi Seo"]
|
9
9
|
spec.email = ["civitaspo@gmail.com", "sonots@gmail.com"]
|
10
10
|
|
data/test/test_in_cat_sweep.rb
CHANGED
@@ -24,7 +24,8 @@ class CatSweepInputTest < Test::Unit::TestCase
|
|
24
24
|
]
|
25
25
|
|
26
26
|
CONFIG_MINIMUM_REQUIRED =
|
27
|
-
if current_fluent_version < fluent_version('0.12.0')
|
27
|
+
if current_fluent_version < fluent_version('0.12.0') ||
|
28
|
+
current_fluent_version >= fluent_version('0.14.0')
|
28
29
|
CONFIG_BASE + %[
|
29
30
|
format tsv
|
30
31
|
keys ""
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-cat-sweep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Civitaspo(takahiro.nakayama)
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-08-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|
@@ -130,6 +130,7 @@ files:
|
|
130
130
|
- gemfiles/Gemfile.fluentd.0.10
|
131
131
|
- gemfiles/Gemfile.fluentd.0.10.45
|
132
132
|
- gemfiles/Gemfile.fluentd.0.12
|
133
|
+
- gemfiles/Gemfile.fluentd.0.14
|
133
134
|
- lib/fluent/plugin/in_cat_sweep.rb
|
134
135
|
- test/helper.rb
|
135
136
|
- test/test_in_cat_sweep.rb
|
@@ -153,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
154
|
version: '0'
|
154
155
|
requirements: []
|
155
156
|
rubyforge_project:
|
156
|
-
rubygems_version: 2.
|
157
|
+
rubygems_version: 2.6.11
|
157
158
|
signing_key:
|
158
159
|
specification_version: 4
|
159
160
|
summary: Fluentd plugin to cat files and move them.
|