Skip to content

Tracking Numbers

Filter

This filter identifies tracking numbers in text. FedEx, UPS, and USPS tracking number formats are supported.

By default a tracking number must be written without spaces, except for a 20-digit USPS number beginning with 92, 93, 94, or 95 and written in groups of four digits, such as 9400 1000 0000 0000 0000, which is always detected. Set allowSpaces to true to detect other spaced forms.

Required Parameters

This filter has no required parameters.

Optional Parameters

Parameter Description Default Value
trackingNumberFilterStrategies A list of filter strategies. None
enabled When set to false, the filter will be disabled and not applied true
ignored A list of terms to be ignored by the filter. None
ups When set to false, UPS tracking number formats are not detected. true
fedex When set to false, FedEx tracking number formats are not detected. true
usps When set to false, USPS tracking number formats are not detected. true
allowSpaces When set to true, a tracking number is also detected when written with single spaces between its characters, such as 1Z 999 AA1 0123 4567 84. This also makes other spaced runs of digits of the same lengths match, such as 1234 5678 9012, which has the length of a FedEx number, so it can report values that are not tracking numbers. false

Filter Strategies

The filter may have zero or more filter strategies. When no filter strategy is given the default strategy of REDACT is used. When multiple filter strategies are given, they are evaluated in the order listed and only the first one whose condition is satisfied, or that has no condition, is applied. See Filter Strategies for details.

Strategy Description
REDACT Replace the sensitive text with a placeholder.
RANDOM_REPLACE Replace the sensitive text with a similar, random value.
STATIC_REPLACE Replace the sensitive text with a given value.
CRYPTO_REPLACE Replace the sensitive text with its encrypted value.
HASH_SHA256_REPLACE Replace the sensitive text with its SHA256 hash value.
FPE_ENCRYPT_REPLACE Replace the sensitive text with a value generated by format-preserving encryption (FPE)
LAST_4 Replace the sensitive text with just the last four characters of the text.

Conditions

Each filter strategy may have one condition. See Conditions for details.

Conditional Description Operators
TOKEN Compares the value of the sensitive text. ==, !=, startswith
CONTEXT Compares the filtering context. == , !=
CONFIDENCE Compares the confidence in the sensitive text against a threshold value. < , <=, > , >=, ==, !=

Example Policy

{
   "identifiers": {
      "trackingNumber": {
         "trackingNumberFilterStrategies": [
            {
               "strategy": "REDACT",
               "redactionFormat": "{{{REDACTED-%t}}}"
            }
         ]
      }
   }
}