All Products
Search
Document Center

Simple Log Service:Native plugin: Data masking

Last Updated:Aug 22, 2025

The Logtail data masking plugin masks 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 field that stores the log content before it is parsed.

Data Masking Method

The method used to mask sensitive content. Valid values are:

  • const: Replaces the sensitive content with a string that you specify.

  • md5: Replaces the sensitive content with its MD5 hash.

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

An expression that matches the content that precedes the sensitive content. This expression is used to locate the sensitive content. You must use the RE2 syntax. For more information, see RE2 syntax.

Content Expression To Match Replaced Content

An expression that matches the sensitive content. You must use the RE2 syntax. For more information, see RE2 syntax.

Replace All Matched Content

  • If you select Replace All Matched Content, all content in the field that matches the expression is replaced.

  • If you do not select Replace All Matched Content, only the first instance of content that matches the expression is replaced.

Configuration example

  • Original field

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

  • Parsing result

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

References