All Products
Search
Document Center

:Data masking

Last Updated:Dec 21, 2023

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:

  • const: replaces the sensitive content with the value of the const field.

  • md5: replaces the sensitive content with the MD5 hash value that is generated for the content.

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

  • If you select the Replace All Matched Content parameter, all sensitive content in the field is replaced.

  • If you do not select the Replace All Matched Content parameter, only the sensitive content matched the first time in the field is replaced.

Configuration example

  • Original field

    content:[{'account':'1812213231432969','password':'04a23f38'}, {'account':'1812213685634','password':'123a'}]
  • Logtail plug-in configurationimage.png

  • Parsing result

    [{'account':'1812213231432969','password':'********'}, {'account':'1812213685634','password':'********'}]