You need to enable JavaScript to run this app.
Torch Log Service

Torch Log Service

Copy page
Download PDF
LogCollector plugins
Data desensitization plugin
Copy page
Download PDF
Data desensitization plugin
Desensitization is a common method for protecting sensitive data and can effectively prevent data leaks. When using LogCollector to collect logs, you can specify fields for desensitization. The desensitize plugin replaces sensitive log content with corresponding MD5 values.​
Notice​
  • This plugin is supported in LogCollector V1.0.34 and later versions. To view LogCollector version, see 2. View software version.​
  • When configuring the desensitize plugin, we recommend that you disable Upload parsing failure log and Upload original log to protect your sensitive information.​
Parameters description​
​
Name​
Type​
Required​
Description​
field​
String​
Yes​
Name of the field to be desensitized.​
Field names must be unique and non-empty, and cannot contain periods (.).​
type​
String​
Yes​
The desensitization method for sensitive log content. Supports setting as the following:​
  • md5: MD5 desensitization. The desensitize plugin replaces sensitive log content with corresponding MD5 values.​
extract_type​
String​
Yes​
Method for extracting sensitive log content. Supported settings:​
  • full: All original field log content is classified as sensitive and must be masked.​
  • regex: Log content in the original field matched by a specified regular expression is classified as sensitive and must be masked.​
when​
Object​
No​
The plugin execution condition. This plugin is executed only when the condition is evaluated as true. For more details, see Plugin execution conditions.​
pattern​
String​
No​
Regular expression for matching sensitive log content. Pattern is required only when extract_type is set to regex.​
If multiple sensitive log entries in the original field match the regular expression, all of them will be desensitized.​
ignore_missing​
Boolean​
No​
This parameter determines whether to skip fields that do not exist.​
  • true (default): If no field exists, it is ignored.​
  • false: If no field exists, an error is reported.​
​
Configuration examples​
  • Key-value pair logs processed by collection mode or other processor plugins:​
  • ​
    "data": "Click Here"​
    "size": "36"​
    "style": "bold"​
    "name": "text1"​
    "hOffset": "250"​
    "vOffset": "100"​
    "alignment": "center"​
    "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"​
    "time": "Today is 2023-06-08. Tomorrow is 2023-06-09."​
    ​
  • LogCollector plugin processor configuration:​
  • ​
    {​
    "processors":[​
    {​
    "desensitize":[​
    {​
    "field":"alignment",​
    "type":"md5",​
    "extract_type":"full"​
    },​
    {​
    "field":"data",​
    "type":"md5",​
    "extract_type":"regex",​
    "pattern":"[a-h]+"​
    }​
    ]​
    }​
    ]​
    }​
    ​
  • Processing result​
  • ​
    "data": "Cli4a8a08f09d37b73795649038408b5f33k He1671797c52e15f763380b45e841ec32re1671797c52e15f763380b45e841ec32"​
    "size": "36"​
    "style": "bold"​
    "name": "text1"​
    "hOffset": "250"​
    "vOffset": "100"​
    "alignment": "adb115059e28d960fa8badfac5516667"​
    "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"​
    "time": "Today is 2023-06-08. Tomorrow is 2023-06-09."​
    ​
​
Last updated: 2025.12.05 15:26:14