fluent-plugin-rewrite-tag-filter 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +20 -10
- data/example.conf +132 -96
- data/example2.conf +63 -37
- data/fluent-plugin-rewrite-tag-filter.gemspec +2 -1
- data/lib/fluent/plugin/out_rewrite_tag_filter.rb +2 -3
- data/test/plugin/test_out_rewrite_tag_filter.rb +24 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 923eb79a49da0ca4228a99a46a93aeb00f055b731fe926744975070298dae18f
|
4
|
+
data.tar.gz: 23ec0537cbd6458f2ef0f93b5aaa6c4735336286298b5eca816e8bf841b6a868
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25fe8090f75fd442e36d4d46bd30aa8e015782f02744d26169070fd2b67a483051842a1999e2e19e7d4f72e0e1658d32708bf326306e91ca96d494f5b7911e35
|
7
|
+
data.tar.gz: 2d9e6a376e2e1db22d238d72c791ea43c1b6c478ffbd1923c9cd81dc67773d2f769f3feb2238d20b247327cb3d2e685d7655a3dcd054f9792ac6ef352bdc4c18
|
data/README.md
CHANGED
@@ -46,7 +46,9 @@ For more details, see [Plugin Management](https://docs.fluentd.org/v0.14/article
|
|
46
46
|
### \<rule\> section (optional) (multiple)
|
47
47
|
|
48
48
|
* **key** (string) (required): The field name to which the regular expression is applied
|
49
|
-
* **pattern** (regexp) (required): The regular expression
|
49
|
+
* **pattern** (regexp) (required): The regular expression.
|
50
|
+
`/regexp/` is preferred because `/regexp/` style can support character classes such as `/[a-z]/`.
|
51
|
+
The pattern without slashes will cause errors if you use patterns start with character classes.
|
50
52
|
* **tag** (string) (required): New tag
|
51
53
|
* **invert** (bool) (optional): If true, rewrite tag when unmatch pattern
|
52
54
|
* Default value: `false`
|
@@ -74,39 +76,39 @@ It's a sample to exclude some static file log before split tag by domain.
|
|
74
76
|
capitalize_regex_backreference yes
|
75
77
|
<rule>
|
76
78
|
key path
|
77
|
-
pattern
|
79
|
+
pattern /\.(gif|jpe?g|png|pdf|zip)$/
|
78
80
|
tag clear
|
79
81
|
</rule>
|
80
82
|
<rule>
|
81
83
|
key status
|
82
|
-
pattern
|
84
|
+
pattern /^200$/
|
83
85
|
tag clear
|
84
86
|
invert true
|
85
87
|
</rule>
|
86
88
|
<rule>
|
87
89
|
key domain
|
88
|
-
pattern
|
90
|
+
pattern /^.+\.com$/
|
89
91
|
tag clear
|
90
92
|
invert true
|
91
93
|
</rule>
|
92
94
|
<rule>
|
93
95
|
key domain
|
94
|
-
pattern
|
96
|
+
pattern /^maps\.example\.com$/
|
95
97
|
tag site.ExampleMaps
|
96
98
|
</rule>
|
97
99
|
<rule>
|
98
100
|
key domain
|
99
|
-
pattern
|
101
|
+
pattern /^news\.example\.com$/
|
100
102
|
tag site.ExampleNews
|
101
103
|
</rule>
|
102
104
|
<rule>
|
103
105
|
key domain
|
104
|
-
pattern
|
106
|
+
pattern /^(mail)\.(example)\.com$/
|
105
107
|
tag site.$2$1
|
106
108
|
</rule>
|
107
109
|
<rule>
|
108
110
|
key domain
|
109
|
-
pattern
|
111
|
+
pattern /.+/
|
110
112
|
tag site.unmatched
|
111
113
|
</rule>
|
112
114
|
</match>
|
@@ -161,7 +163,11 @@ Dot notation:
|
|
161
163
|
```
|
162
164
|
<match kubernetes.**>
|
163
165
|
@type rewrite_tag_filter
|
164
|
-
|
166
|
+
<rule>
|
167
|
+
key $.kubernetes.namespace_name
|
168
|
+
pattern ^(.+)$
|
169
|
+
tag $1.${tag}
|
170
|
+
</rule>
|
165
171
|
</match>
|
166
172
|
```
|
167
173
|
|
@@ -170,7 +176,11 @@ Bracket notation:
|
|
170
176
|
```
|
171
177
|
<match kubernetes.**>
|
172
178
|
@type rewrite_tag_filter
|
173
|
-
|
179
|
+
<rule>
|
180
|
+
key $['kubernetes']['namespace_name']
|
181
|
+
pattern ^(.+)$
|
182
|
+
tag $1.${tag}
|
183
|
+
</rule>
|
174
184
|
</match>
|
175
185
|
```
|
176
186
|
|
data/example.conf
CHANGED
@@ -2,15 +2,17 @@
|
|
2
2
|
|
3
3
|
# appearing plugins:
|
4
4
|
# rewrite_tag_filter: http://rubygems.org/gems/fluent-plugin-rewrite-tag-filter
|
5
|
-
# forest: http://rubygems.org/gems/fluent-plugin-forest
|
6
5
|
# datacounter: http://rubygems.org/gems/fluent-plugin-datacounter
|
7
6
|
# growthforecast: http://rubygems.org/gems/fluent-plugin-growthforecast
|
8
7
|
|
9
8
|
<source>
|
10
|
-
type tail
|
9
|
+
@type tail
|
11
10
|
path /var/log/httpd/access_log
|
12
|
-
|
13
|
-
|
11
|
+
<parse>
|
12
|
+
@type regexp
|
13
|
+
expression /^(?<domain>[^ ]*) (?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<status>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)" (?<response_time>[^ ]*))?$/
|
14
|
+
time_format %d/%b/%Y:%H:%M:%S %z
|
15
|
+
</parse>
|
14
16
|
tag td.apache.access
|
15
17
|
pos_file /var/log/td-agent/apache_access.pos
|
16
18
|
</source>
|
@@ -18,139 +20,173 @@
|
|
18
20
|
|
19
21
|
# Extract specified virtual domain
|
20
22
|
<match td.apache.access>
|
21
|
-
type copy
|
23
|
+
@type copy
|
22
24
|
<store>
|
23
|
-
type rewrite_tag_filter
|
25
|
+
@type rewrite_tag_filter
|
24
26
|
capitalize_regex_backreference yes
|
25
|
-
|
27
|
+
<rule>
|
28
|
+
key domain
|
29
|
+
pattern /^(maps|news|mail)\.google\.com$/
|
30
|
+
tag site.Google$1
|
31
|
+
</rule>
|
26
32
|
</store>
|
27
33
|
<store>
|
28
|
-
type rewrite_tag_filter
|
34
|
+
@type rewrite_tag_filter
|
29
35
|
capitalize_regex_backreference yes
|
30
|
-
|
36
|
+
<rule>
|
37
|
+
key domain
|
38
|
+
pattern /^(maps)\.google\.com$/
|
39
|
+
tag sitepath.Google$1
|
40
|
+
</rule>
|
31
41
|
</store>
|
32
42
|
</match>
|
33
43
|
|
34
44
|
|
35
45
|
# Second level analyzing
|
36
46
|
<match sitepath.GoogleMaps>
|
47
|
+
@type copy
|
37
48
|
<store>
|
38
|
-
type rewrite_tag_filter
|
39
|
-
|
40
|
-
|
41
|
-
|
49
|
+
@type rewrite_tag_filter
|
50
|
+
<rule>
|
51
|
+
key path
|
52
|
+
pattern /^\/labs/
|
53
|
+
tag site.GoogleMaps.Labs
|
54
|
+
</rule>
|
55
|
+
<rule>
|
56
|
+
key path
|
57
|
+
pattern /^\/static/\d+/
|
58
|
+
tag site.GoogleMaps.Static
|
59
|
+
</rule>
|
60
|
+
<rule>
|
61
|
+
key path
|
62
|
+
pattern /^\/help\/maps\/(streetview|getmaps)/
|
63
|
+
tag site.GoogleMaps.Help
|
64
|
+
</rule>
|
42
65
|
</store>
|
43
66
|
<store>
|
44
|
-
type rewrite_tag_filter
|
45
|
-
|
46
|
-
|
67
|
+
@type rewrite_tag_filter
|
68
|
+
<rule>
|
69
|
+
key referer
|
70
|
+
pattern /headlines\.yahoo\.co\.jp/
|
71
|
+
tag site.GoogleMaps.referer_YahooHeadlines
|
72
|
+
</rule>
|
73
|
+
<rule>
|
74
|
+
key referer
|
75
|
+
pattern /news\.livedoor\.com/
|
76
|
+
tag site.GoogleMaps.referer_LivedoorNews
|
77
|
+
</rule>
|
47
78
|
</store>
|
48
79
|
<store>
|
49
|
-
type rewrite_tag_filter
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
80
|
+
@type rewrite_tag_filter
|
81
|
+
<rule>
|
82
|
+
key agent
|
83
|
+
pattern /Googlebot\//
|
84
|
+
tag site.GoogleMaps.agent_Googlebot
|
85
|
+
</rule>
|
86
|
+
<rule>
|
87
|
+
key agent
|
88
|
+
pattern /^.* iPhone .+Googlebot-Mobile\/.*$/
|
89
|
+
tag site.GoogleMaps.agent_GooglebotSmartphone
|
90
|
+
</rule>
|
91
|
+
<rule>
|
92
|
+
key agent
|
93
|
+
pattern /Googlebot-Mobile\//
|
94
|
+
tag site.GoogleMaps.agent_GooglebotMobile
|
95
|
+
</rule>
|
96
|
+
<rule>
|
97
|
+
key agent
|
98
|
+
pattern /bingbot/
|
99
|
+
tag site.GoogleMaps.agent_Bingbot
|
100
|
+
</rule>
|
101
|
+
<rule>
|
102
|
+
key agent
|
103
|
+
pattern /Baiduspider/
|
104
|
+
tag site.GoogleMaps.agent_Baiduspider
|
105
|
+
</rule>
|
55
106
|
</store>
|
56
107
|
</match>
|
57
108
|
|
58
109
|
|
59
110
|
# Summarize
|
60
111
|
<match site.**>
|
61
|
-
type copy
|
112
|
+
@type copy
|
62
113
|
<store>
|
63
|
-
type
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
pattern7 10sec_over ^\d{8,}$
|
78
|
-
</template>
|
114
|
+
@type datacounter
|
115
|
+
unit minute
|
116
|
+
count_key response_time
|
117
|
+
outcast_unmatched false
|
118
|
+
aggregate tag
|
119
|
+
tag_prefix gf.responsetime
|
120
|
+
output_per_tag yes
|
121
|
+
pattern1 0-100msec ^\d{1,5}$
|
122
|
+
pattern2 100-300msec ^[1-2]\d{5}$
|
123
|
+
pattern3 300-600msec ^[3-5]\d{5}$
|
124
|
+
pattern4 600msec-1sec ^[6-9]\d{5}$
|
125
|
+
pattern5 1-2sec ^1\d{6}$
|
126
|
+
pattern6 2-10sec ^[2-9]\d{6}$
|
127
|
+
pattern7 10sec_over ^\d{8,}$
|
79
128
|
</store>
|
80
129
|
<store>
|
81
|
-
type
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
pattern10 500 ^5\d\d$
|
99
|
-
</template>
|
130
|
+
@type datacounter
|
131
|
+
unit minute
|
132
|
+
outcast_unmatched false
|
133
|
+
aggregate tag
|
134
|
+
tag_prefix gf.responsecode
|
135
|
+
output_per_tag yes
|
136
|
+
count_key status
|
137
|
+
pattern1 200 ^200$
|
138
|
+
pattern2 2xx ^2\d\d$
|
139
|
+
pattern3 301 ^301$
|
140
|
+
pattern4 302 ^302$
|
141
|
+
pattern5 3xx ^3\d\d$
|
142
|
+
pattern6 403 ^403$
|
143
|
+
pattern7 404 ^404$
|
144
|
+
pattern8 410 ^410$
|
145
|
+
pattern9 4xx ^4\d\d$
|
146
|
+
pattern10 500 ^5\d\d$
|
100
147
|
</store>
|
101
148
|
<store>
|
102
|
-
type
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
pattern5 pc .+
|
115
|
-
</template>
|
149
|
+
@type datacounter
|
150
|
+
unit minute
|
151
|
+
count_key agent
|
152
|
+
outcast_unmatched false
|
153
|
+
aggregate tag
|
154
|
+
tag_prefix gf.useragent
|
155
|
+
output_per_tag yes
|
156
|
+
pattern1 api HttpRequest
|
157
|
+
pattern2 robot (spider|bot|crawler|\+http\:)
|
158
|
+
pattern3 smartphone (iPhone|iPod|Android|dream|CUPCAKE|blackberry|webOS|incognito|webmate|IEMobile)
|
159
|
+
pattern4 mobile (^KDDI|UP.Browser|DoCoMo|Vodafone|SoftBank|WILLCOM)
|
160
|
+
pattern5 pc .+
|
116
161
|
</store>
|
117
162
|
</match>
|
118
163
|
|
119
164
|
|
120
165
|
# Graph
|
121
166
|
<match gf.responsetime.**>
|
122
|
-
type
|
123
|
-
subtype growthforecast
|
167
|
+
@type growthforecast
|
124
168
|
remove_prefix gf.responsetime.site
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
name_keys 0-100msec_percentage,100-300msec_percentage,300-600msec_percentage,600msec-1sec_percentage,1-2sec_percentage,2-10sec_percentage,10sec_over_percentage
|
130
|
-
</template>
|
169
|
+
gfapi_url http://localhost:5125/api/
|
170
|
+
tag_for service
|
171
|
+
section response_time
|
172
|
+
name_keys 0-100msec_percentage,100-300msec_percentage,300-600msec_percentage,600msec-1sec_percentage,1-2sec_percentage,2-10sec_percentage,10sec_over_percentage
|
131
173
|
</match>
|
132
174
|
|
133
175
|
<match gf.responsecode.**>
|
134
|
-
type
|
135
|
-
subtype growthforecast
|
176
|
+
@type growthforecast
|
136
177
|
remove_prefix gf.responsecode.site
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
name_keys 301_count,302_count,3xx_count,403_count,404_count,410_count,4xx_count,500_count
|
142
|
-
</template>
|
178
|
+
gfapi_url http://localhost:5125/api/
|
179
|
+
tag_for service
|
180
|
+
section response_code
|
181
|
+
name_keys 301_count,302_count,3xx_count,403_count,404_count,410_count,4xx_count,500_count
|
143
182
|
</match>
|
144
183
|
|
145
184
|
<match gf.useragent.**>
|
146
|
-
type
|
147
|
-
subtype growthforecast
|
185
|
+
@type growthforecast
|
148
186
|
remove_prefix gf.useragent.site
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
name_keys pc_count,mobile_count,smartphone_count,robot_count,api_count
|
154
|
-
</template>
|
187
|
+
gfapi_url http://localhost:5125/api/
|
188
|
+
tag_for service
|
189
|
+
section useragent
|
190
|
+
name_keys pc_count,mobile_count,smartphone_count,robot_count,api_count
|
155
191
|
</match>
|
156
192
|
|
data/example2.conf
CHANGED
@@ -7,10 +7,13 @@
|
|
7
7
|
# growthforecast: http://rubygems.org/gems/fluent-plugin-growthforecast
|
8
8
|
|
9
9
|
<source>
|
10
|
-
type tail
|
10
|
+
@type tail
|
11
11
|
path /var/log/httpd/access_log
|
12
|
-
|
13
|
-
|
12
|
+
<parse>
|
13
|
+
@type regexp
|
14
|
+
expression /^(?<domain>[^ ]*) (?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<status>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)" (?<response_time>[^ ]*))?$/
|
15
|
+
time_format %d/%b/%Y:%H:%M:%S %z
|
16
|
+
</parse>
|
14
17
|
tag td.apache.access
|
15
18
|
pos_file /var/log/td-agent/apache_access.pos
|
16
19
|
</source>
|
@@ -18,60 +21,83 @@
|
|
18
21
|
|
19
22
|
# Extract specified virtual domain
|
20
23
|
<match td.apache.access>
|
21
|
-
type rewrite_tag_filter
|
22
|
-
|
24
|
+
@type rewrite_tag_filter
|
25
|
+
<rule>
|
26
|
+
key domain
|
27
|
+
pattern /^maps\.google\.com$/
|
28
|
+
tag filter.GoogleMap
|
29
|
+
</rule>
|
23
30
|
</match>
|
24
31
|
|
25
32
|
|
26
33
|
# Filtering
|
27
34
|
<match filter.GoogleMap>
|
28
|
-
type rewrite_tag_filter
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
+
@type rewrite_tag_filter
|
36
|
+
<rule>
|
37
|
+
key path
|
38
|
+
pattern /^\/(img|css|js|static|assets)\//
|
39
|
+
tag clear
|
40
|
+
</rule>
|
41
|
+
<rule>
|
42
|
+
key status
|
43
|
+
pattern /^(?!200)$/
|
44
|
+
tag clear
|
45
|
+
</rule>
|
46
|
+
<rule>
|
47
|
+
key method
|
48
|
+
pattern /^(?!GET)$/
|
49
|
+
tag clear
|
50
|
+
</rule>
|
51
|
+
<rule>
|
52
|
+
key agent
|
53
|
+
pattern /(spider|bot|crawler|\+http\:)/
|
54
|
+
tag clean
|
55
|
+
</rule>
|
56
|
+
<rule>
|
57
|
+
key path
|
58
|
+
pattern /^\/(admin|api|backend)/
|
59
|
+
tag site.GoogleMap.backend
|
60
|
+
</rule>
|
61
|
+
<rule>
|
62
|
+
key path
|
63
|
+
pattern /.+/
|
64
|
+
tag site.GoogleMap.front
|
65
|
+
</rule>
|
35
66
|
</match>
|
36
67
|
|
37
68
|
|
38
69
|
# Summarize
|
39
70
|
<match site.**>
|
40
|
-
type
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
pattern7 10sec_over ^\d{8,}$
|
55
|
-
</template>
|
71
|
+
@type datacounter
|
72
|
+
unit minute
|
73
|
+
count_key response_time
|
74
|
+
outcast_unmatched false
|
75
|
+
aggregate tag
|
76
|
+
tag_prefix gf.responsetime
|
77
|
+
output_per_tag yes
|
78
|
+
pattern1 0-100msec ^\d{1,5}$
|
79
|
+
pattern2 100-300msec ^[1-2]\d{5}$
|
80
|
+
pattern3 300-600msec ^[3-5]\d{5}$
|
81
|
+
pattern4 600msec-1sec ^[6-9]\d{5}$
|
82
|
+
pattern5 1-2sec ^1\d{6}$
|
83
|
+
pattern6 2-10sec ^[2-9]\d{6}$
|
84
|
+
pattern7 10sec_over ^\d{8,}$
|
56
85
|
</match>
|
57
86
|
|
58
87
|
|
59
88
|
# Graph
|
60
89
|
<match gf.responsetime.**>
|
61
|
-
type
|
62
|
-
subtype growthforecast
|
90
|
+
@type growthforecast
|
63
91
|
remove_prefix gf.responsetime.site
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
name_keys 0-100msec_percentage,100-300msec_percentage,300-600msec_percentage,600msec-1sec_percentage,1-2sec_percentage,2-10sec_percentage,10sec_over_percentage
|
69
|
-
</template>
|
92
|
+
gfapi_url http://localhost:5125/api/
|
93
|
+
tag_for service
|
94
|
+
section response_time
|
95
|
+
name_keys 0-100msec_percentage,100-300msec_percentage,300-600msec_percentage,600msec-1sec_percentage,1-2sec_percentage,2-10sec_percentage,10sec_over_percentage
|
70
96
|
</match>
|
71
97
|
|
72
98
|
|
73
99
|
# Clear tag
|
74
100
|
<match clear>
|
75
|
-
type null
|
101
|
+
@type null
|
76
102
|
</match>
|
77
103
|
|
@@ -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.1.0"
|
7
7
|
s.license = "Apache-2.0"
|
8
8
|
s.authors = ["Kentaro Yoshida"]
|
9
9
|
s.email = ["y.ken.studio@gmail.com"]
|
@@ -18,4 +18,5 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.add_development_dependency "test-unit", ">= 3.1.0"
|
19
19
|
s.add_development_dependency "rake"
|
20
20
|
s.add_runtime_dependency "fluentd", [">= 0.14.2", "< 2"]
|
21
|
+
s.add_runtime_dependency "fluent-config-regexp-type"
|
21
22
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "fluent/plugin/output"
|
2
|
+
require "fluent/config/regexp_type"
|
2
3
|
|
3
4
|
class Fluent::Plugin::RewriteTagFilterOutput < Fluent::Plugin::Output
|
4
5
|
Fluent::Plugin.register_output('rewrite_tag_filter', self)
|
@@ -16,9 +17,7 @@ class Fluent::Plugin::RewriteTagFilterOutput < Fluent::Plugin::Output
|
|
16
17
|
desc "The field name to which the regular expression is applied"
|
17
18
|
config_param :key, :string
|
18
19
|
desc "The regular expression"
|
19
|
-
config_param :pattern
|
20
|
-
Regexp.compile(value)
|
21
|
-
end
|
20
|
+
config_param :pattern, :regexp
|
22
21
|
desc "New tag"
|
23
22
|
config_param :tag, :string
|
24
23
|
desc "If true, rewrite tag when unmatch pattern"
|
@@ -17,6 +17,30 @@ class RewriteTagFilterOutputTest < Test::Unit::TestCase
|
|
17
17
|
create_driver(conf)
|
18
18
|
end
|
19
19
|
end
|
20
|
+
|
21
|
+
test "pattern with character classes" do
|
22
|
+
conf = %[
|
23
|
+
<rule>
|
24
|
+
key $['email']['domain']
|
25
|
+
pattern /[sv]d[a-z]+\\d*$/
|
26
|
+
tag $2.$1
|
27
|
+
</rule>
|
28
|
+
]
|
29
|
+
d = create_driver(conf)
|
30
|
+
assert_equal(/[sv]d[a-z]+\d*$/, d.instance.rules.first.pattern)
|
31
|
+
end
|
32
|
+
|
33
|
+
test "pattern w/o slashes" do
|
34
|
+
conf = %[
|
35
|
+
<rule>
|
36
|
+
key $['email']['domain']
|
37
|
+
pattern .+
|
38
|
+
tag $2.$1
|
39
|
+
</rule>
|
40
|
+
]
|
41
|
+
d = create_driver(conf)
|
42
|
+
assert_equal(/.+/, d.instance.rules.first.pattern)
|
43
|
+
end
|
20
44
|
end
|
21
45
|
|
22
46
|
sub_test_case "section style" do
|
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.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kentaro Yoshida
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-unit
|
@@ -58,6 +58,20 @@ dependencies:
|
|
58
58
|
- - "<"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '2'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: fluent-config-regexp-type
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :runtime
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
61
75
|
description:
|
62
76
|
email:
|
63
77
|
- y.ken.studio@gmail.com
|
@@ -97,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
111
|
version: '0'
|
98
112
|
requirements: []
|
99
113
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.6
|
114
|
+
rubygems_version: 2.7.6
|
101
115
|
signing_key:
|
102
116
|
specification_version: 4
|
103
117
|
summary: Fluentd Output filter plugin. It has designed to rewrite tag like mod_rewrite.
|