From 6cbca707f2652fff6c41dcf56773911ead1e3863 Mon Sep 17 00:00:00 2001 From: Ruthryi Date: Fri, 8 Oct 2021 13:15:03 +0530 Subject: [PATCH 1/2] Add note to avoid parsing escaope characters --- .../logs/masking_sensitive_info_in_logs.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/en/micro-integrator/docs/administer-and-observe/logs/masking_sensitive_info_in_logs.md b/en/micro-integrator/docs/administer-and-observe/logs/masking_sensitive_info_in_logs.md index 8c69b5a73..000c52f21 100644 --- a/en/micro-integrator/docs/administer-and-observe/logs/masking_sensitive_info_in_logs.md +++ b/en/micro-integrator/docs/administer-and-observe/logs/masking_sensitive_info_in_logs.md @@ -33,6 +33,9 @@ You can specify one or more masking patterns in the `/conf/deployment.t With this configuration, each log line is checked for all the configured patterns. If any match is found, it is masked with ‘*****’. +!!! danger "Using single quotes in TOML configs to avoid parsing escape characters" + The TOML parser reads the `deployment.toml` file and parse its value before generating a relevant configuration file. If the strings defined in the TOML file are within double quotes, it parses the string with escape characters and writes the resulting value on the config file. Therefore, you can avoid parsing escape characters by using single quotes. This allows the parser to read the TOML value without parsing and write on the config file as it is. + !!! note The following feature is released as a product update on 08th of December, 2020. If you don't already have this update, you can [get the latest updates](https://updates.docs.wso2.com/en/latest/updates/overview/) now. From 3e371f54d6a5f7c9a97f50b590578e02dce16e57 Mon Sep 17 00:00:00 2001 From: Ruthryi Date: Fri, 8 Oct 2021 18:23:22 +0530 Subject: [PATCH 2/2] Updated after review --- .../logs/masking_sensitive_info_in_logs.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/en/micro-integrator/docs/administer-and-observe/logs/masking_sensitive_info_in_logs.md b/en/micro-integrator/docs/administer-and-observe/logs/masking_sensitive_info_in_logs.md index 000c52f21..49b2a183c 100644 --- a/en/micro-integrator/docs/administer-and-observe/logs/masking_sensitive_info_in_logs.md +++ b/en/micro-integrator/docs/administer-and-observe/logs/masking_sensitive_info_in_logs.md @@ -34,7 +34,13 @@ You can specify one or more masking patterns in the `/conf/deployment.t With this configuration, each log line is checked for all the configured patterns. If any match is found, it is masked with ‘*****’. !!! danger "Using single quotes in TOML configs to avoid parsing escape characters" - The TOML parser reads the `deployment.toml` file and parse its value before generating a relevant configuration file. If the strings defined in the TOML file are within double quotes, it parses the string with escape characters and writes the resulting value on the config file. Therefore, you can avoid parsing escape characters by using single quotes. This allows the parser to read the TOML value without parsing and write on the config file as it is. + If the strings defined in the `deployment.toml` file are within double quotes, it is parsed along with the escape characters. To avoid this, use single quotes when you need to add escape characters as shown in the example below. + ``` + [masking_pattern.properties] + "ACCT_ID" = '(?<=accountId\':)(.*)(?=\')' + "ACCT_ID.replace_pattern"='(.?).(?=.*)' + "ACCT_ID.replacer"="*" + ``` !!! note The following feature is released as a product update on 08th of December, 2020. If you don't already have this update, you can [get the latest updates](https://updates.docs.wso2.com/en/latest/updates/overview/) now.