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": "myEmail@example.net",
"list1": [
"user1@example.com",
"user2@example.org"
],
"a": {
"nested": {
"field": "name3@example.museum"
}
},
"email_string": "Jane Doe <jane@example.name>, John Smith <john@example.name>"
}
{
"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 |
---|---|
user@example.com |
no change |
user@subdomain.example.com |
no change |
user@example.museum |
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