How do you scrub PII from logs in the pipeline?

IntermediateProductionLog Pipelines
Answer

Do it as early as possible, ideally in the app (do not log it), with a safety net in the pipeline. Example Vector transform:

[transforms.scrub]
type = "remap"
inputs = ["k8s_logs"]
source = '''
.message = redact(string!(.message), filters: [r'\b[\w.+-]+@[\w-]+\.[\w.]+\b', r'\b(?:\d[ -]?){13,16}\b'])
del(.authorization)
del(.password)
'''

The OTel Collector has the redaction and transform processors for the same job. Test patterns against sample logs in CI and audit the stored data periodically.

All Monitoring & Observability questions Roadmap: Logging & tracing

More on Log Pipelines