All Products
Search
Document Center

Simple Log Service:Native plug-in: Data Masking

Last Updated:Apr 18, 2025

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 stores the log content before parsing.

Data Masking Method

The method that is used to mask the 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 the Data Masking Method parameter 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 content preceding the sensitive content. The expression is used to find the sensitive content. You must use the RE2 syntax to specify the expression. For more information, see RE2 syntax.

Content Expression to Match Replaced Content

The expression that is used to match the 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 the sensitive content in the original field is replaced.

  • If you do not select the Replace All Matched Content parameter, only the sensitive content matched the first time in the original 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':'********'}]