fluent-plugin-rewrite-tag-filter 1.4.1 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -1
- data/README.md +23 -14
- data/fluent-plugin-rewrite-tag-filter.gemspec +2 -2
- data/lib/fluent/plugin/out_rewrite_tag_filter.rb +9 -4
- metadata +6 -6
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -9,14 +9,17 @@ user-agent, request-uri, regex-backreference and so on with regular expression.
|
|
9
9
|
|
10
10
|
## Installation
|
11
11
|
|
12
|
-
Install with gem or
|
12
|
+
Install with `gem`, `fluent-gem` or `td-agent-gem` command as:
|
13
13
|
|
14
14
|
```
|
15
|
-
# for fluentd
|
15
|
+
# for system installed fluentd
|
16
16
|
$ gem install fluent-plugin-rewrite-tag-filter
|
17
17
|
|
18
18
|
# for td-agent
|
19
19
|
$ sudo /usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-rewrite-tag-filter
|
20
|
+
|
21
|
+
# for td-agent2
|
22
|
+
$ sudo td-agent-gem install fluent-plugin-rewrite-tag-filter
|
20
23
|
```
|
21
24
|
|
22
25
|
## Configuration
|
@@ -35,6 +38,9 @@ remove_tag_prefix <string>
|
|
35
38
|
|
36
39
|
# Optional: override hostname command for placeholder. (see the section of "Tag placeholder")
|
37
40
|
hostname_command <string>
|
41
|
+
|
42
|
+
# Optional: Set log level for this plugin. (ex: trace, debug, info, warn, error, fatal)
|
43
|
+
log_level <string> (default info)
|
38
44
|
```
|
39
45
|
|
40
46
|
### Usage
|
@@ -180,42 +186,45 @@ https://github.com/y-ken/fluent-plugin-rewrite-tag-filter/blob/master/example2.c
|
|
180
186
|
|
181
187
|
## Related Articles
|
182
188
|
|
183
|
-
- 自在にタグを書き換える fluent-plugin-rewrite-tag-filter でログ解析が捗るお話 #fluentd
|
189
|
+
- 自在にタグを書き換える fluent-plugin-rewrite-tag-filter でログ解析が捗るお話 #fluentd<br>
|
184
190
|
http://d.hatena.ne.jp/yoshi-ken/20120701/1341137269
|
185
191
|
|
186
|
-
- Fluentd & TreasureDataで こっそり始めるログ集計 Fluentd Meetup #2 @mikeda
|
192
|
+
- Fluentd & TreasureDataで こっそり始めるログ集計 Fluentd Meetup #2 @mikeda<br>
|
187
193
|
http://www.slideshare.net/baguzy/fluentd-meetup-2-14073930
|
188
194
|
|
189
|
-
- 似てる #fluentd
|
195
|
+
- 似てる #fluentd プラグインの比較<br>
|
190
196
|
http://matsumana.wordpress.com/2012/11/15/%E4%BC%BC%E3%81%A6%E3%82%8B-fluentd-%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%81%AE%E6%AF%94%E8%BC%83/
|
191
197
|
|
192
|
-
- Fluentdの集約サーバ用設定ファイル (fluent-plugin-rewrite-tag-filter版)
|
198
|
+
- Fluentdの集約サーバ用設定ファイル (fluent-plugin-rewrite-tag-filter版)<br>
|
193
199
|
https://gist.github.com/matsumana/4078096
|
194
200
|
|
195
|
-
- 稼働中のFluentdにflowcounter plugin
|
201
|
+
- 稼働中のFluentdにflowcounter pluginを導入してみた<br>
|
196
202
|
http://dayafterneet.blogspot.jp/2012/12/fluentdflowcounter-plugin.html
|
197
203
|
|
198
|
-
- fluent-plugin-rewrite-tag-filter v1.2.0 をリリースしました。新機能であるremove_tag_prefix設定の使い方を解説します。 #fluentd
|
204
|
+
- fluent-plugin-rewrite-tag-filter v1.2.0 をリリースしました。新機能であるremove_tag_prefix設定の使い方を解説します。 #fluentd<br>
|
199
205
|
http://y-ken.hatenablog.com/entry/fluent-plugin-rewrite-tag-filter-v1.2.0
|
200
206
|
|
201
|
-
- fluent-plugin-rewrite-tag-filter v1.2.1 をリリースしました。設定サンプルと共にプレースホルダ機能強化内容を紹介します。 #fluentd
|
207
|
+
- fluent-plugin-rewrite-tag-filter v1.2.1 をリリースしました。設定サンプルと共にプレースホルダ機能強化内容を紹介します。 #fluentd<br>
|
202
208
|
http://y-ken.hatenablog.com/entry/fluent-plugin-rewrite-tag-filter-v1.2.1
|
203
209
|
|
204
|
-
- 待望の正規表現の否定パターンに対応した fluent-plugin-rewrite-tag-filter v1.3.0 をリリースしました #fluentd
|
210
|
+
- 待望の正規表現の否定パターンに対応した fluent-plugin-rewrite-tag-filter v1.3.0 をリリースしました #fluentd<br>
|
205
211
|
http://y-ken.hatenablog.com/entry/fluent-plugin-rewrite-tag-filter-v1.3.0
|
206
212
|
|
207
|
-
- 不具合修正版 fluent-plugin-rewrite-tag-filter v1.3.1 をリリースしました #fluentd
|
213
|
+
- 不具合修正版 fluent-plugin-rewrite-tag-filter v1.3.1 をリリースしました #fluentd<br>
|
208
214
|
http://y-ken.hatenablog.com/entry/fluent-plugin-rewrite-tag-filter-v1.3.1
|
209
215
|
|
210
|
-
- PostgreSQLのログをfluentdで回収する設定 — still deeper
|
216
|
+
- PostgreSQLのログをfluentdで回収する設定 — still deeper<br>
|
211
217
|
http://chopl.in/blog/2013/06/07/postgresql_csv_log_with_fluentd.html
|
212
218
|
|
213
|
-
- S3とFluentdを用いた効率的なログ管理 | SmartNews
|
219
|
+
- S3とFluentdを用いた効率的なログ管理 | SmartNews開発者ブログ<br>
|
214
220
|
http://developer.smartnews.be/blog/2013/09/02/an-effective-log-management-technique-which-uses-fluentd-and-s3/
|
215
221
|
|
216
|
-
- fluentd(td-agent) の導入 : Raccoon Tech Blog [株式会社ラクーン 技術戦略部ブログ]
|
222
|
+
- fluentd(td-agent) の導入 : Raccoon Tech Blog [株式会社ラクーン 技術戦略部ブログ]<br>
|
217
223
|
http://techblog.raccoon.ne.jp/archives/35031163.html
|
218
224
|
|
225
|
+
- fluent-plugin-rewrite-tag-filter v1.4.1 をリリースしました #fluentd<br>
|
226
|
+
http://y-ken.hatenablog.com/entry/fluent-plugin-rewrite-tag-filter-v1.4.1
|
227
|
+
|
219
228
|
## TODO
|
220
229
|
|
221
230
|
Pull requests are very welcome!!
|
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "fluent-plugin-rewrite-tag-filter"
|
6
|
-
s.version = "1.
|
6
|
+
s.version = "1.5.1"
|
7
7
|
s.license = "Apache 2.0"
|
8
8
|
s.authors = ["Kentaro Yoshida"]
|
9
9
|
s.email = ["y.ken.studio@gmail.com"]
|
@@ -17,5 +17,5 @@ Gem::Specification.new do |s|
|
|
17
17
|
|
18
18
|
s.add_development_dependency "rake"
|
19
19
|
s.add_runtime_dependency "fluentd"
|
20
|
-
s.add_runtime_dependency "string-scrub"
|
20
|
+
s.add_runtime_dependency "string-scrub", "= 0.0.3" if RUBY_VERSION.to_f < 2.1
|
21
21
|
end
|
@@ -7,9 +7,14 @@ class Fluent::RewriteTagFilterOutput < Fluent::Output
|
|
7
7
|
|
8
8
|
MATCH_OPERATOR_EXCLUDE = '!'
|
9
9
|
|
10
|
+
# Define `log` method for v0.10.42 or earlier
|
11
|
+
unless method_defined?(:log)
|
12
|
+
define_method("log") { $log }
|
13
|
+
end
|
14
|
+
|
10
15
|
def initialize
|
11
16
|
super
|
12
|
-
require 'string/scrub'
|
17
|
+
require 'string/scrub' if RUBY_VERSION.to_f < 2.1
|
13
18
|
end
|
14
19
|
|
15
20
|
def configure(conf)
|
@@ -31,7 +36,7 @@ class Fluent::RewriteTagFilterOutput < Fluent::Output
|
|
31
36
|
|
32
37
|
@rewriterules.push([rewritekey, /#{trim_regex_quote(regexp)}/, get_match_operator(regexp), rewritetag])
|
33
38
|
rewriterule_names.push(rewritekey + regexp)
|
34
|
-
|
39
|
+
log.info "adding rewrite_tag_filter rule: #{key} #{@rewriterules.last}"
|
35
40
|
end
|
36
41
|
|
37
42
|
unless @rewriterules.length > 0
|
@@ -72,7 +77,7 @@ class Fluent::RewriteTagFilterOutput < Fluent::Output
|
|
72
77
|
rewritetag = rewritetag.gsub(/\$\d+/, backreference_table)
|
73
78
|
end
|
74
79
|
rewritetag = rewritetag.gsub(/(\${[a-z_]+(\[[0-9]+\])?}|__[A-Z_]+__)/) do
|
75
|
-
|
80
|
+
log.warn "rewrite_tag_filter: unknown placeholder found. :placeholder=>#{$1} :tag=>#{tag} :rewritetag=>#{rewritetag}" unless placeholder.include?($1)
|
76
81
|
placeholder[$1]
|
77
82
|
end
|
78
83
|
return rewritetag
|
@@ -100,7 +105,7 @@ class Fluent::RewriteTagFilterOutput < Fluent::Output
|
|
100
105
|
|
101
106
|
def trim_regex_quote(regexp)
|
102
107
|
if regexp.start_with?('"') && regexp.end_with?('"')
|
103
|
-
|
108
|
+
log.info "rewrite_tag_filter: [DEPRECATED] Use ^....$ pattern for partial word match instead of double-quote-delimiter. #{regexp}"
|
104
109
|
regexp = regexp[1..-2]
|
105
110
|
end
|
106
111
|
if regexp.start_with?(MATCH_OPERATOR_EXCLUDE)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-rewrite-tag-filter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-10-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -48,17 +48,17 @@ dependencies:
|
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
49
|
none: false
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - '='
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: 0.0.3
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
none: false
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 0.0.3
|
62
62
|
description:
|
63
63
|
email:
|
64
64
|
- y.ken.studio@gmail.com
|