Skip to content

Commit

Permalink
logs: do not copy non matching content when apply MaskSequences
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux committed Feb 8, 2025
1 parent ba9f4f1 commit 4dfa826
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/logs/processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ func (p *Processor) applyRedactingRules(msg *message.Message) bool {
return false
}
case config.MaskSequences:
content = rule.Regex.ReplaceAll(content, rule.Placeholder)
if rule.Regex.Match(content) {
content = rule.Regex.ReplaceAll(content, rule.Placeholder)
}
}
}

Expand Down

0 comments on commit 4dfa826

Please sign in to comment.