fluent-plugin-maskrx 0.0.1.beta2 → 0.0.1.beta6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/filter-plugin-maskrx.gemspec +1 -1
- data/lib/fluent/plugin/filter_maskrx.rb +8 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af4c4b45c83149a60dee9cd643853a49da490dfcc0576e66c84acb1d2dbbd7f1
|
4
|
+
data.tar.gz: 4b80b049f784281a55aed27f3d898e9a0332c1401ac9905429b6916b6c31fedf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19eea3dfc09e708ff36334392ad3a1ba3701b412d1bb3846e4f1661aa2fabe83f73f9803628226ca72db2cb6dc268a26fc352a3b31b42a4e65a9e178bdb48bbd
|
7
|
+
data.tar.gz: 353dd59ef66efd4f73579b619e545fd21fcf87950c642ce70630eee83562d938a81e2b055b6c36cc30b389d5ca720a521ec60e9c0de2ee83d6fa1532528753b7
|
@@ -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-maskrx"
|
7
|
-
spec.version = "0.0.1.
|
7
|
+
spec.version = "0.0.1.beta6"
|
8
8
|
spec.authors = ["Joshua Mervine"]
|
9
9
|
spec.email = ["joshua@mervine.net"]
|
10
10
|
spec.summary = %q{Fluentd filter plugin to mask strings within records.}
|
@@ -17,13 +17,18 @@ module Fluent::Plugin
|
|
17
17
|
def configure(conf)
|
18
18
|
super
|
19
19
|
|
20
|
+
patterns = []
|
20
21
|
@mask_config_list.each do |config|
|
21
22
|
raise Fluent::ConfigError, "pattern is required" if config.pattern.nil?
|
23
|
+
|
24
|
+
patterns.push(config.pattern)
|
22
25
|
end
|
26
|
+
|
27
|
+
log.info("plugin=maskrx at=configure patterns=\"#{patterns}\"")
|
23
28
|
end
|
24
29
|
|
25
30
|
def filter(_, _, record)
|
26
|
-
log.debug("
|
31
|
+
log.debug("plugin=maskrx at=filter record=\"#{record}\"")
|
27
32
|
|
28
33
|
@mask_config_list.each do |config|
|
29
34
|
record = mask_record(config, record)
|
@@ -35,6 +40,7 @@ module Fluent::Plugin
|
|
35
40
|
protected
|
36
41
|
def mask_record(config, record)
|
37
42
|
keys = (config.keys.nil? ? record.keys : config.keys)
|
43
|
+
log.debug("plugin=maskrx at=mask_record keys=\"#{keys}\"")
|
38
44
|
|
39
45
|
keys.each do |key|
|
40
46
|
record[key] = mask_key_value(config.pattern, config.mask, record[key]) unless record[key].nil?
|
@@ -55,7 +61,7 @@ module Fluent::Plugin
|
|
55
61
|
value.gsub!(m, mask)
|
56
62
|
end
|
57
63
|
|
58
|
-
log.debug("
|
64
|
+
log.debug("plugin=maskrx at=mask_key_value pattern=#{pattern} value=\"#{value}\"")
|
59
65
|
|
60
66
|
return value
|
61
67
|
end
|