User Guide
Also available as:
PDF

JSONPath-Based Anonymization Rules

JSONPath-based rules anonymize JSON data using JSONPath.

Required and Optional Fields

  • name

  • rule_id (should be set to JSONPATH)

  • paths

  • include_files

  • exclude_files (optional)

  • action (optional, default value is ANONYMIZE)

  • replace_value (optional, applicable only when action=REPLACE)

  • shared (optional, default value is true)

  • enabled (optional, default value is true)

For more information on each field, refer to Fields Used for Defining Anonymization Rules.

Rule Definition Example

  {
    "name": "JSONPATH_RULE",
    "rule_id": "JSONPATH",
    "paths": ["$.users[0].password"],
    "include_files": ["*test_config.json"],
    "shared": true
  }

Sample Input JSON Data

  {
    "users": [
      {
        "name": "Logsearch Admin",
        "username": "admin",
        "password": "testdata"
      },
      {
        "name": "Admin",
        "username": "admin",
        "password": "test data"
      }
    ]
  }

Sample Output JSON Data (After Anonymization)

  {
    "users": [
      {
        "name": "Logsearch Admin",
        "username": "admin",
        "password": "¶smfvvcz9¶"
      },
      {
        "name": "Admin",
        "username": "admin",
        "password": "test data"
      }
    ]
  }

For more examples, refer to Examples of JSONPath-Based Anonymization Rules.

You can use this reference documentation for JSONPath.