Redact/Mask Value

Redact/Mask all values with a pattern specified by regex in a key

The Redact/Mask Value action hides all values with a pattern specified by regex in the key by replacing it with a certain character, such as *(default). When applied to your processing rule, the Redact/Mask Value action will conceal every occurrence of the specified regex pattern in the values of key by replacing it with your preferred character for every record in your pipeline.

For example, given the following sample website log data:

{"timestamp":"2023-03-28T09:08:41.64283645Z","user_id":3,"page_id":30,"action":"purchase"}
{"timestamp":"2023-03-28T09:08:42.643343109Z","user_id":4,"page_id":10,"action":"purchase"}
{"timestamp":"2023-03-28T09:08:48.643600498Z","user_id":1,"page_id":50,"action":"click"}
{"timestamp":"2023-03-28T09:08:50.643773688Z","user_id":5,"page_id":40,"action":"purchase"}
{"timestamp":"2023-03-28T09:08:51.643932272Z","user_id":1,"page_id":30,"action":"purchase"}
{"timestamp":"2023-03-28T09:08:56.644080944Z","user_id":2,"page_id":40,"action":"click"}
{"timestamp":"2023-03-28T09:09:03.64425954Z","user_id":3,"page_id":30,"action":"click"}
{"timestamp":"2023-03-28T09:09:03.644317046Z","user_id":1,"page_id":20,"action":"view"}
{"timestamp":"2023-03-28T09:09:10.64447719Z","user_id":2,"page_id":50,"action":"purchase"}
{"timestamp":"2023-03-28T09:09:17.644810963Z","user_id":2,"page_id":10,"action":"view"}
{"timestamp":"2023-03-28T09:09:20.644994805Z","user_id":1,"page_id":50,"action":"view"}

To conceal every occurrence of the purchase value in every record of your pipeline by replacing it with *:

  1. In the processing rules tab, in the Actions dropdown, select Redact/Mask value.

  2. In the Key field, enter action.

  3. In the Regex field, enter purchase.

  4. In the Replacement characters field, enter *.

  5. Click Apply.

Your processing rule will now replace any occurrence of the value purchase in the key action with the character *.

Last updated