You can use a Logtail plug-in to mask the sensitive content in logs.
Entry point
If you want to use a Logtail plug-in to process logs, you can add a Logtail plug-in configuration when you create or modify a Logtail configuration. For more information, see Overview.
Configuration description
Parameter | Description |
Original Field | The original field that is used to store the content of a log before the log is parsed. |
Data Masking Method | The method that is used to mask sensitive content. Valid values:
|
Replacement String | If you set Data Masking Method to const, you must specify a string to replace the sensitive content. |
Content Expression that Precedes Replaced Content | The expression that is used to match the prefix of sensitive content. The expression is used to find sensitive content. You must use the RE2 syntax to specify the expression. For more information, visit RE2 syntax. |
Content Expression to Match Replaced Content | The expression that is used to match sensitive content. You must use the RE2 syntax to specify the expression. For more information, visit RE2 syntax. |
Replace All Matched Content |
|
Configuration example
Original field
content:[{'account':'1812213231432969','password':'04a23f38'}, {'account':'1812213685634','password':'123a'}]
Logtail plug-in configuration
Parsing result
[{'account':'1812213231432969','password':'********'}, {'account':'1812213685634','password':'********'}]