fluent-plugin-maskrx 0.0.1.beta1 → 0.0.1.beta5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +2 -0
- data/filter-plugin-maskrx.gemspec +1 -1
- data/lib/fluent/plugin/filter_maskrx.rb +14 -2
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 53c6cd92c58cb24980f19661bb163ad618be7b51de7719e62de8e58c6a3625db
|
4
|
+
data.tar.gz: 037b09d8fce4cada16feefc80574d4277367610902e4f6659bef98b642302fc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc625745020d967198afdd21aeeebdbf42e4f477f706144af28b86b1bb2bd1d21c65094b2edc420de81fce23e4ffb6a5a5b94f785c609250b51b7ebf7edcd5dd
|
7
|
+
data.tar.gz: a1052813ccc2b2b1bcfecfda30980f670b4cdf410ce3e320c3934a76cb657a17dea9fb051df25d00f872fa58821d57bddfcc14611c40c5843d7420c9ab6f262b
|
data/.gitignore
CHANGED
@@ -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.beta5"
|
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.}
|
@@ -16,12 +16,21 @@ module Fluent::Plugin
|
|
16
16
|
|
17
17
|
def configure(conf)
|
18
18
|
super
|
19
|
-
end
|
20
19
|
|
21
|
-
|
20
|
+
patterns = []
|
22
21
|
@mask_config_list.each do |config|
|
23
22
|
raise Fluent::ConfigError, "pattern is required" if config.pattern.nil?
|
24
23
|
|
24
|
+
patterns.push(config.pattern)
|
25
|
+
end
|
26
|
+
|
27
|
+
log.info("pluginx=maskrx at=configure patterns=\"#{patterns}\"")
|
28
|
+
end
|
29
|
+
|
30
|
+
def filter(_, _, record)
|
31
|
+
log.debug("plugin=maskrx at=filter record=\"#{record}\"")
|
32
|
+
|
33
|
+
@mask_config_list.each do |config|
|
25
34
|
record = mask_record(config, record)
|
26
35
|
end
|
27
36
|
|
@@ -31,6 +40,7 @@ module Fluent::Plugin
|
|
31
40
|
protected
|
32
41
|
def mask_record(config, record)
|
33
42
|
keys = (config.keys.nil? ? record.keys : config.keys)
|
43
|
+
log.debug("plugin=maskrx at=mask_record keys=\"#{keys}\"")
|
34
44
|
|
35
45
|
keys.each do |key|
|
36
46
|
record[key] = mask_key_value(config.pattern, config.mask, record[key]) unless record[key].nil?
|
@@ -51,6 +61,8 @@ module Fluent::Plugin
|
|
51
61
|
value.gsub!(m, mask)
|
52
62
|
end
|
53
63
|
|
64
|
+
log.debug("plugin=maskrx at=mask_key_value pattern=#{pattern} value=\"#{value}\"")
|
65
|
+
|
54
66
|
return value
|
55
67
|
end
|
56
68
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-maskrx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.beta5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Mervine
|
@@ -121,8 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: 1.3.1
|
123
123
|
requirements: []
|
124
|
-
|
125
|
-
rubygems_version: 2.5.2
|
124
|
+
rubygems_version: 3.1.4
|
126
125
|
signing_key:
|
127
126
|
specification_version: 4
|
128
127
|
summary: Fluentd filter plugin to mask strings within records.
|