Field Masker
The Field Masker masks string values based on the selected mask type. You can use variable-length, fixed-length, custom, or regular expression masks. Custom masks can reveal part of the string value.
Use the Field Masker to mask sensitive string data. For example, you might use a custom mask to mask the last four digits of a phone number.
Mask Types
You can use the following mask types to mask data:
- Fixed-length
- Replaces values with a fixed-length mask. Use when you want to mask variations in the length of the data.
- Variable-length
- Replaces values with a variable-length mask. Use when you want to reveal the lengths of the original data.
- Custom
- Replaces values with a mask based on a user-defined pattern. When you define the pattern for the mask, you can use a hash mark (#) to reveal the character in that location. All other characters are used as constants in the mask.
- Regular Expression
- Replaces groups of values with a variable-length mask. You define the data structure with a regular expression, using parentheses to define groups of values. You can optionally specify any groups of data that you do not want to mask. If you do not specify groups, Field Masker masks all values.
Configuring a Field Masker Processor
-
In the Properties panel, on the General tab, configure the
following properties:
General Property Description Name Stage name. Description Optional description. Required Fields Fields that must include data for the record to be passed into the stage. Tip: You might include fields that the stage uses.Records that do not include all required fields are processed based on the error handling configured for the pipeline.
Preconditions Conditions that must evaluate to TRUE to allow a record to enter the stage for processing. Click Add to create additional preconditions. Records that do not meet all preconditions are processed based on the error handling configured for the stage.
On Record Error Error record handling for the stage: - Discard - Discards the record.
- Send to Error - Sends the record to the pipeline for error handling.
- Stop Pipeline - Stops the pipeline. Not valid for cluster pipelines.
-
On the Mask tab, configure the following
properties:
Field Masker Property Description Fields to Mask One or more String fields to mask with the same mask type. You can use the asterisk wildcard to represent array indices and map elements.
You can specify individual fields or use a field path expression to specify a set of fields.
Mask Type Mask type to hide field values. Select one of the following options: - Fixed-length - Replaces values with a fixed-length mask.
- Variable-length - Replaces values with a mask the length of the original value.
- Custom - Replaces values with a user-defined mask.
- Regular Expression - Replaces groups of values based on the groups defined by the regular expression and the groups to reveal.
Custom Mask Mask pattern for a custom mask. Enter the pattern that you want to use. Use the hash mark (#) to display characters in the specified location. Use any other character as a masking character.
Regular Expression Regular expression that describes the data in the masked fields. If you want to display a group of data, use parentheses to define groups within the pattern. For example, ([0-9]{5}) - ([0-9]{3}-[0-9]{2}-[0-9]{4}) .
Groups to Show Optional comma-separated list of groups to show. Use 1 to represent the first group. - To mask another field, click the Add icon, and then repeat the previous step. You can use simple or bulk edit mode to mask another field.