数据脱敏

简介

processor_desensitize插件可以通过正则表达式匹配并实现文本日志中敏感数据的脱敏。源代码

版本

Beta

配置参数

参数
类型,默认值
说明

Type

String,无默认值(必填)

插件类型,固定为processor_desensitize

SourceKey

String,无默认值(必填)

日志字段名称。

Method

String,无默认值(必填)

脱敏方式。可选值如下: const:将敏感内容替换成 ReplaceString 参数处配置等字符串。 md5:将敏感内容替换为其对应的MD5值。

Match

String,无默认值(必填)

指定敏感数据。可选值如下: full:字段全文。 regex:使用正则提取敏感数据。

ReplaceString

String,无默认值

用于替换敏感内容等字符串,当 Method 设置为 const 时必选。

RegexBegin

String,无默认值

用于指定敏感内容前缀的正则表达式,当 Match 配置为 regex 时必选。

RegexContent

String,无默认值

用于指定敏感内容的正则表达式,当 Match 配置为 regex 时必选。

样例

采集/home/test-ilogtail/test-log/路径下包含敏感数据的processor-desensitize.log文件,根据指定的配置选项提取日志信息。

  • 输入

  • 采集配置1

  • 输出1

  • 采集配置2

  • 输出2

  • 采集配置3

  • 输出3

Last updated