TLS DSL offers a regular expression replacement function. You can hide sensitive data in logs by using regex replacements, which reduces the risk of sensitive data leakage.
Phone number masking
To desensitize a phone number, you can use the regex replacement function to substitute the middle digits of a phone number with specified characters. For example, use the regex_replace function to replace the middle four digits of an 11-digit phone number, so the full number is not displayed.
Raw log
DSL processing rules
Processing result
IP address masking
To achieve IP address masking, you can use the regex replacement function to substitute the middle digits of an IP address with a specified character. For example, if a log contains an IP address, you can use the regex_replace function to identify and mask the IP address with regular expressions.
Raw log
DSL processing rules
Processing result
Email address masking
To achieve email address masking, you can use a regular expression replacement function to replace the prefix of an email address with specified characters. For example, if the following log contains a complete email address, you can replace the prefix of the email address so that all characters except the first are replaced with *. Through this method, the displayed email address will not be shown as full address.
Raw log
DSL processing rules
Processing result