I am using the value_pattern to anonymize the value of the msg key from log. It is observed that the fluent-plugin-anonymizer hashes the entire string which ‘has’ the matching pattern.
Can you add support for hashing only the part of matching string and not the entire value?
Sample Config:
<filter **>
@type anonymizer
<mask sha1>
value_pattern UserId:\d{3}-?\d{3}
</mask>
</filter>
Log Sample:
{ "level": "INFO", "timezone": "UTC", "threadname": "main", "msg": "Logged in UserId:123-456"}
Output:
{ "level": "INFO", "timezone": "UTC", "threadname": "main", "msg": "<hashed value>"}
Expected Output:
{"level": "INFO", "timezone": "UTC", "threadname": "main", "msg": "Logged in <hashed value>"}
I am using the value_pattern to anonymize the value of the msg key from log. It is observed that the fluent-plugin-anonymizer hashes the entire string which ‘has’ the matching pattern.
Can you add support for hashing only the part of matching string and not the entire value?