Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for masking a part of string within a value #32

Open
TejasKM opened this issue Jan 25, 2022 · 0 comments
Open

Support for masking a part of string within a value #32

TejasKM opened this issue Jan 25, 2022 · 0 comments

Comments

@TejasKM
Copy link

TejasKM commented Jan 25, 2022

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>"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant