Dates
Describes Philter's Date filter.

Filter

This filter identifies dates such as May 22, 2014 in text. The supported date formats are:
Format
Example
yyyy-MM-d
2020-05-10
MM-dd-yyyy
05-10-2020
M-d-y
5-10-2020
MMM dd
May 5 or May 05
MMMM dd, yyyy
May 5, 2020 or May 5 2020

Required Parameters

This filter has no required parameters.

Optional Parameters

Parameter
Description
Default Value
dateFilterStrategies
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
onlyValidDates
When set to true, only valid dates will be filtered.
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 the filter strategies will be applied in order as they are listed. 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.
SHIFT
Shift the date by a number of months, days, and/or years.
RELATIVE
Replace the date by a words relative to the date.

Filter Strategy Options

The following filter strategy options are available for the RELATIVE filter strategy.
Description
Default Value
futureDates
When true, future dates are replaced by relative words. When false, future dates are redacted.
false
The following filter strategy options are available for the SHIFT filter strategy.
Option
Description
Default Value
shiftDays
The number of days to shift the date. Can be a negative or positive integer. Defaults to 0 if not specified.
0
shiftMinutes
The number of minutes to shift the date. Can be a negative or positive integer. Defaults to 0 if not specified.
0
shiftYears
The number of years to shift the date. Can be a negative or positive integer. Defaults to 0 if not specified.
0

Conditions

Each filter strategy may have one condition. See Conditions for details.
Conditional
Description
Operators
TOKEN
Compares the value of the sensitive text.
== , !=
TOKEN
Compares the sensitive text to some category, e.g. birthdate.
is
CONTEXT
Compares the filtering context.
== , !=
CONFIDENCE
Compares the confidence in the sensitive text against a threshold value.
< , <=, > , >=, ==, !=

Differentiating Between Dates and Birth Dates

In some cases it may be necessary to redact birth dates and dates differently. Using conditions it is possible to determine if an identified date is a birth date. The conditional token is birthdate will determine if the identified date (token) is a birth date by analyzing the content surrounding the date.

Example Filter Profile to Redact Dates

The following filter profile redacts dates.
1
{
2
"name": "dates-example",
3
"identifiers": {
4
"date": {
5
"onlyValidDates": false,
6
"dateFilterStrategies": [
7
{
8
"strategy": "REDACT",
9
"redactionFormat": "{{{REDACTED-%t}}}"
10
}
11
]
12
}
13
}
14
}
Copied!

Example Filter Profile to Shift Dates

The following filter profile to shift dates forward by 2 days and 4 months.
1
{
2
"name": "dates-example",
3
"identifiers": {
4
"date": {
5
"onlyValidDates": false,
6
"dateFilterStrategies": [
7
{
8
"strategy": "SHIFT",
9
"shiftDays": 2,
10
"shiftMonths": 4,
11
"shiftYears": 0
12
}
13
]
14
}
15
}
16
}
Copied!