Redact
Synopsis
Uses Grok patterns to identify and redact sensitive information in text fields. Matches are replaced with configurable prefix/suffix markers.
Schema
redact:
- field: <ident>
- patterns: <string[]>
- description: <text>
- if: <script>
- ignore_failure: <boolean>
- ignore_missing: <boolean>
- on_failure: <processor[]>
- on_success: <processor[]>
- pattern_definitions: <map[string]string>
- prefix: <string>
- skip_if_unlicensed: <boolean>
- suffix: <string>
- tag: <string>
Configuration
Field | Required | Default | Description |
---|---|---|---|
field | Y | - | Field containing text to be redacted |
patterns | Y | - | List of Grok patterns to match and redact |
description | N | - | Explanatory note |
if | N | - | Condition to run |
ignore_failure | N | false | See Handling Failures |
ignore_missing | N | false | If true , continue silently if field doesn't exist |
on_failure | N | - | See Handling Failures |
on_success | N | - | See Handling Success |
pattern_definitions | N | - | Map of custom Grok pattern definitions |
prefix | N | < | Prefix for redacted text |
suffix | N | > | Suffix for redacted text |
skip_if_unlicensed | N | false | Skip processing if license doesn't support redaction |
tag | N | - | Identifier |
Details
This processor is particularly useful for protecting Personally Identifiable Information (PII) by replacing sensitive data like email addresses, IP addresses, credit card numbers, and other patterns with redacted placeholders.
The redact processor uses Grok pattern matching, which is case-sensitive by default. For case-insensitive matching, modify your patterns accordingly.
Applying many patterns to large volumes of text may impact performance. Consider limiting pattern complexity and the number of patterns in such cases.
Examples
Emails
Starting with a document containing an email address... |
|
the email is replaced with a redacted marker: |
|
Multiple Patterns
Redact multiple types of sensitive data... |
|
with custom markers: |
|
Custom
Define custom patterns for specific formats... |
|
matching specialized formats: |
|
Error Handling
In case of a missing field... |
|
display message: |
|