01 Dec 2025 11:01 PM
Guys, does anyone know of a way to mask sensitive data within the log content?
The scenario is this: we have log ingestion, but the environment doesn't use a oneagent; it's all opentelemetry. There are several log format standards, so creating a rule for each one would be impractical. I'd like to understand if I can, for example, identify in the processing anything containing the key 'cpf' or 'cnpj', and if so, remove and/or mask it. All of this is within the log content.
I used the DPL below, but it only worked for one of the patterns. There are several others. So if there's a way to do something more generic, that would be great.
Does anyone know of or have done something similar?
USING(INOUT content)
//| FIELDS_ADD(content: REPLACE_PATTERN(content, "'numberDocument' LD LD LD LD DATA:numberDocument'\\\"' ", "cpf-masked"))