fluent-plugin-maskrx 0.0.1.beta6 → 0.0.1.beta7

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: af4c4b45c83149a60dee9cd643853a49da490dfcc0576e66c84acb1d2dbbd7f1
4
- data.tar.gz: 4b80b049f784281a55aed27f3d898e9a0332c1401ac9905429b6916b6c31fedf
3
+ metadata.gz: 2f4d9adc48590e5e99a1d09210b1dee00b94cd763e5b910a59562c05e669aa59
4
+ data.tar.gz: ee16da1ce58adb70af2bb3911036cd9da645ce01ed666c1cef75ce23182d9777
5
5
  SHA512:
6
- metadata.gz: 19eea3dfc09e708ff36334392ad3a1ba3701b412d1bb3846e4f1661aa2fabe83f73f9803628226ca72db2cb6dc268a26fc352a3b31b42a4e65a9e178bdb48bbd
7
- data.tar.gz: 353dd59ef66efd4f73579b619e545fd21fcf87950c642ce70630eee83562d938a81e2b055b6c36cc30b389d5ca720a521ec60e9c0de2ee83d6fa1532528753b7
6
+ metadata.gz: 2e8decbc5ddd8e693b64cd9240ec55454d4a91f32c9e57f41c7429f98cba82ab6cc9ec46fa8f34d96d78be5bbbc71ea879690f27d308b604f2d15bc5696e2c47
7
+ data.tar.gz: 3f3ecf0fd62724b2e70fa7489503b2bf2da762b79efeac3777689ff31850c1bb03c1933e4798b9aad68d224ca7fa8c40f04a2d44f93a35ef4b50172b5ecd9c8b
@@ -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.beta6"
7
+ spec.version = "0.0.1.beta7"
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.}
@@ -30,17 +30,37 @@ module Fluent::Plugin
30
30
  def filter(_, _, record)
31
31
  log.debug("plugin=maskrx at=filter record=\"#{record}\"")
32
32
 
33
+ mask_record(config, record)
34
+ end
35
+
36
+ def filter_stream(tag, es)
37
+ new_es = Fluent::MultiEventStream.new
38
+ es.each do |time, record|
39
+ log.debug("plugin=maskrx at=filter_stream record=\"#{record}\"")
40
+
41
+ new_es.add(time, mask_record(record))
42
+ end
43
+
44
+ new_es
45
+ end
46
+
47
+ protected
48
+ def mask_record(record)
33
49
  @mask_config_list.each do |config|
34
- record = mask_record(config, record)
50
+ record = mask_entry(config, record)
35
51
  end
36
52
 
37
53
  record
38
54
  end
39
55
 
40
- protected
41
- def mask_record(config, record)
42
- keys = (config.keys.nil? ? record.keys : config.keys)
43
- log.debug("plugin=maskrx at=mask_record keys=\"#{keys}\"")
56
+ def mask_entry(config, record)
57
+ keys = if config.keys.nil? || config.keys.empty?
58
+ record.keys
59
+ else
60
+ config.keys
61
+ end
62
+
63
+ log.debug("plugin=maskrx at=mask_entry keys=\"#{keys}\"")
44
64
 
45
65
  keys.each do |key|
46
66
  record[key] = mask_key_value(config.pattern, config.mask, record[key]) unless record[key].nil?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-maskrx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.beta6
4
+ version: 0.0.1.beta7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Mervine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-15 00:00:00.000000000 Z
11
+ date: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler