fluent-plugin-rewrite-tag-filter 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -6
- data/fluent-plugin-rewrite-tag-filter.gemspec +1 -1
- data/lib/fluent/plugin/out_rewrite_tag_filter.rb +3 -3
- metadata +4 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66217c9c0167159be6c76fdba5f2c56c6b93bc30
|
4
|
+
data.tar.gz: 85e737316d12098d40b5dcacdac87e2169774b0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2adcfbcbd4b645b6c576a46037ca390b65eb5256d0c8e48db94a5608dddef6ee33e80b4dfa0fb40f05662a954ae2d61a5ba925f4659899f1a0c1b6a6a27791a9
|
7
|
+
data.tar.gz: b1df437ae5a40bd43e5756a2a295c20c4ab65769e764f85d30240125b0f60fb35d04e73d547465fd3daed460876bb30fe7e0dc8d4eed8702178e65362a2bda5b
|
data/README.md
CHANGED
@@ -18,23 +18,25 @@ This is an output plugin because fluentd's `filter` doesn't allow tag rewrite.
|
|
18
18
|
|
19
19
|
## Installation
|
20
20
|
|
21
|
-
Install with `gem
|
21
|
+
Install with `gem` or `td-agent-gem` command as:
|
22
22
|
|
23
23
|
```
|
24
24
|
# for system installed fluentd
|
25
25
|
$ gem install fluent-plugin-rewrite-tag-filter
|
26
26
|
|
27
|
-
# for td-agent (Legacy)
|
28
|
-
$ sudo /usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-rewrite-tag-filter -v 1.5.6
|
29
|
-
|
30
27
|
# for td-agent2 (with fluentd v0.12)
|
31
|
-
$ sudo td-agent-gem install fluent-plugin-rewrite-tag-filter -v 1.
|
28
|
+
$ sudo td-agent-gem install fluent-plugin-rewrite-tag-filter -v 1.6.0
|
29
|
+
|
30
|
+
# for td-agent3 (with fluentd v0.14)
|
31
|
+
$ sudo td-agent-gem install fluent-plugin-rewrite-tag-filter
|
32
32
|
```
|
33
33
|
|
34
|
+
For more details, see [Plugin Management](https://docs.fluentd.org/v0.14/articles/plugin-management)
|
35
|
+
|
34
36
|
## Configuration
|
35
37
|
|
36
38
|
* **rewriterule\<num\>** (string) (optional) \<attribute\> \<regex_pattern\> \<new_tag\>
|
37
|
-
*
|
39
|
+
* Obsoleted: Use <rule> section
|
38
40
|
* **capitalize_regex_backreference** (bool) (optional): Capitalize letter for every matched regex backreference. (ex: maps -> Maps) for more details, see usage.
|
39
41
|
* Default value: no
|
40
42
|
* **remove_tag_prefix** (string) (optional): Remove tag prefix for tag placeholder. (see the section of "Tag placeholder")
|
@@ -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 = "2.0.
|
6
|
+
s.version = "2.0.2"
|
7
7
|
s.license = "Apache-2.0"
|
8
8
|
s.authors = ["Kentaro Yoshida"]
|
9
9
|
s.email = ["y.ken.studio@gmail.com"]
|
@@ -67,15 +67,15 @@ class Fluent::Plugin::RewriteTagFilterOutput < Fluent::Plugin::Output
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def process(tag, es)
|
70
|
+
placeholder = get_placeholder(tag)
|
70
71
|
es.each do |time, record|
|
71
|
-
rewrited_tag = rewrite_tag(tag, record)
|
72
|
+
rewrited_tag = rewrite_tag(tag, record, placeholder)
|
72
73
|
next if rewrited_tag.nil? || tag == rewrited_tag
|
73
74
|
router.emit(rewrited_tag, time, record)
|
74
75
|
end
|
75
76
|
end
|
76
77
|
|
77
|
-
def rewrite_tag(tag, record)
|
78
|
-
placeholder = get_placeholder(tag)
|
78
|
+
def rewrite_tag(tag, record, placeholder)
|
79
79
|
@rewriterules.each do |record_accessor, regexp, match_operator, rewritetag|
|
80
80
|
rewritevalue = record_accessor.call(record).to_s
|
81
81
|
next if rewritevalue.empty? && match_operator != MATCH_OPERATOR_EXCLUDE
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-rewrite-tag-filter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kentaro Yoshida
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-unit
|
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
99
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.6.
|
100
|
+
rubygems_version: 2.6.14
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: Fluentd Output filter plugin. It has designed to rewrite tag like mod_rewrite.
|
@@ -105,6 +105,4 @@ summary: Fluentd Output filter plugin. It has designed to rewrite tag like mod_r
|
|
105
105
|
expression. Also you can change a tag from apache log by domain, status-code(ex.
|
106
106
|
500 error), user-agent, request-uri, regex-backreference and so on with regular
|
107
107
|
expression.
|
108
|
-
test_files:
|
109
|
-
- test/helper.rb
|
110
|
-
- test/plugin/test_out_rewrite_tag_filter.rb
|
108
|
+
test_files: []
|