JSON Mask

This is a composite generator.

Runs a selected sub-generator on values that match a user specified JSONPath. You can only search for and apply sub-generators to individual key values. You cannot apply a sub-generator to an object or to an array.

If an error occurs, the selected fallback generator is used for the entirety of the JSON value.

Sequence for applying the sub-generators

Sub-generators are applied sequentially, from the sub-generator at the top of the list to the sub-generator at the bottom of the list.

If multiple JSONPath expressions point to the same key, the most recently added generator takes priority.

JSON path options

Regular expressions and comparisons

JSON paths can also contain regular expressions and comparison logic, which allows the configured sub-generators to be applied only when there are properties that satisfy the query.

For example, a column contains this JSON:

[ { file_name: "foo.txt", b: 10 }, ... ]

The following JSON path only applies to array elements that contain a file_name key for which the value ends in .txt:

$.[?(@.file_Name =~ /^.*.txt$/)]

Using recursion

A JSON path can also be used to point to a key name recursively. For example, a column contains this JSON:

{
  "first_name": "John",
  "last_name": "Smith",
  "children": [
    {
      "first_name": "Mary",
      "last_name": "Jones",
      "children": [
        {
          "first_name": "Ann",
          "last_name": "Jones"
        }
      ]
    }
  ]
}

The following JSON path applies to all properties for which the key is first_name:

$..first_name

Characteristics

Consistency

Determined by the selected sub-generators.

Linking

Determined by the selected sub-generators.

Differential privacy

Determined by the selected sub-generators.

Data-free

Determined by the selected sub-generators.

Allowed for primary keys

No

Allowed for unique columns

No

Uses format-preserving encryption (FPE)

No

Privacy ranking

5

Generator ID (for the API)

How to configure

Adding a sub-generator

To assign a generator to a path expression:

  1. Under Sub-generators, click Add Generator. On the sub-generator configuration panel, the Cell JSON field contains a sample value from the source database. You can use the previous and next icons to page through different values.

  2. In the Path Expression field, type the path expression to identify the value to apply the generator to. To create a path expression, you can also click the value in Cell JSON that you want the expression to point to. The path expression must identify a key value. You cannot apply sub-generators to an object or to an array. Matched JSON Values shows the result from the value in Cell JSON.

  3. By default, the selected generator is applied to any value that matches the expression. To limit the types of values to apply the generator to, from the Type Filter, specify the applicable types. You can select Any, or you can select any combination of String, Number, Boolean, and Null.

  4. From the Generator Configuration dropdown list, select the generator to apply to the path expression. You cannot select another composite generator.

  5. Configure the selected generator. You cannot configure the selected generator to be consistent with another column.

  6. To save the configuration and immediately add a generator for another path expression, click Save and Add Another. To save the configuration and close the add generator panel, click Save.

Managing the sub-generators list

From the Sub-Generators list:

  • To edit a generator assignment, click the edit icon.

  • To remove a generator assignment, click the delete icon.

  • To move a generator assignment up or down in the list, click the up or down arrow.

Selecting the fallback generator

From the Fallback Generator dropdown list, select the generator to use if the assigned generator for a path expression fails.

The options are:

Last updated