fluent-plugin-rewrite-tag-filter 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a976b12b3e1ab4b56116a3690d0c48949ff34788f1b165b39909c52d4e1983d
|
4
|
+
data.tar.gz: 435ca4ea943d418f2803ee787422271850ededecbe20bd82efa518bb5ff12a7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49b4bf86556799b2ac17c37e214754af8ea80489d3817a7026e4aac725ac360605154538e885f4c5cc6843424a1d9575ea383a4fa99c6e3b045169347855ecd2
|
7
|
+
data.tar.gz: 7f34dc3e1f1d5178051d3e2af5d433064bb8219638f4181854c6e712341fa0bdbe52f8baa527e9b66967c79686ea2eccf0641fcaadfce22379e47b9bb7747c59
|
@@ -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.1.
|
6
|
+
s.version = "2.1.1"
|
7
7
|
s.license = "Apache-2.0"
|
8
8
|
s.authors = ["Kentaro Yoshida"]
|
9
9
|
s.email = ["y.ken.studio@gmail.com"]
|
@@ -69,7 +69,10 @@ class Fluent::Plugin::RewriteTagFilterOutput < Fluent::Plugin::Output
|
|
69
69
|
placeholder = get_placeholder(tag)
|
70
70
|
es.each do |time, record|
|
71
71
|
rewrited_tag = rewrite_tag(tag, record, placeholder)
|
72
|
-
|
72
|
+
if rewrited_tag.nil? || tag == rewrited_tag
|
73
|
+
log.trace("rewrite_tag_filter: tag has not been rewritten", record)
|
74
|
+
next
|
75
|
+
end
|
73
76
|
router.emit(rewrited_tag, time, record)
|
74
77
|
end
|
75
78
|
end
|
@@ -284,5 +284,27 @@ class RewriteTagFilterOutputTest < Test::Unit::TestCase
|
|
284
284
|
events = d.events
|
285
285
|
assert_equal "com.example", events[0][0]
|
286
286
|
end
|
287
|
+
|
288
|
+
test "tag has not been rewritten and log_level trace" do
|
289
|
+
conf = %[
|
290
|
+
@log_level trace
|
291
|
+
<rule>
|
292
|
+
key $['email']['domain']
|
293
|
+
pattern ^(example)\.(com)$
|
294
|
+
tag $2.$1
|
295
|
+
</rule>
|
296
|
+
]
|
297
|
+
d = create_driver(conf)
|
298
|
+
d.run(default_tag: "input") do
|
299
|
+
d.feed({ "email" => { "localpart" => "john", "domain" => "example.com" }})
|
300
|
+
d.feed({ "email" => { "localpart" => "doe", "domain" => "example.jp" }})
|
301
|
+
end
|
302
|
+
events = d.events
|
303
|
+
assert_equal(1, events.size)
|
304
|
+
log = d.logs.grep(/\[trace\]/).first
|
305
|
+
assert_equal('rewrite_tag_filter: tag has not been rewritten email={"localpart"=>"doe", "domain"=>"example.jp"}',
|
306
|
+
log.slice(/\[trace\]: (.+)$/, 1))
|
307
|
+
assert_equal "com.example", events[0][0]
|
308
|
+
end
|
287
309
|
end
|
288
310
|
end
|
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.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kentaro Yoshida
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-unit
|