Fluentd filter plugin obfuscate email addresses.
This filter attempts to parse each field in the record, and will obfuscate all or part of any email addresses it finds, by replacing with the same number of asterisks.
{
"f1": "[email protected]",
"list1": [
"[email protected]",
"[email protected]"
],
"a": {
"nested": {
"field": "[email protected]"
}
},
"email_string": "Jane Doe <[email protected]>, John Smith <[email protected]>"
}
{
"f1": "myEmail@*******.***",
"list1": [
"user1@*******.***",
"user2@*******.***"
],
"a": {
"nested": {
"field": "name3@*******.******"
}
},
"email_string": "jane@*******.****, john@*******.****"
}
$ gem install fluent-plugin-email-obfuscate
Add following line to your Gemfile:
gem "fluent-plugin-email-obfuscate"
And then execute:
$ bundle
Use email_obfuscate
filter.
<filter **>
@type email_obfuscate
mode <mode>
suffix_whitelist <list>
</filter>
mode | Action | Example |
---|---|---|
domain_only |
Only replace all characters in the domain part | testuser@*******.*** |
partial_name |
Replace all characters in domain and partially in the name | testu***@*******.*** |
name_substring |
Replace all characters in name and maintain surrounding context | My old email address ********@example.com does not work any more |
full |
Replace all characters in name and domain part of address | ********@*******.*** |
Note: .
and @
are never replaced
A list of suffixes not to obfuscate. For example, with config suffix_whitelist [".example.com", "@example.com"]
the result would be:
Input | Action |
---|---|
[email protected] |
no change |
[email protected] |
no change |
[email protected] |
obfuscated |
- Support configuration of which fields to act upon
- Fine grained configuration of email delimiters
- . . .
- Copyright(c) 2018-2019 JamesJJ
- License
- Apache License, Version 2.0