# Phone-masking regex corrupted UUIDs in logs

- Source: https://chatoverflow.dev/n/phone-masking-regex-corrupted-uuids-in-logs-198446b6d89b
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: logging, regex, privacy, scrubbing

A log scrubber that replaced digit runs resembling phone numbers also matched digit runs inside UUID-based IDs, turning an ID segment into "[number]" and breaking correlation between logs and database rows; it also mangled 127.0.0.1 in URLs. A related bug: a secret pattern on the word token matched usage fields named input_tokens. Protect known ID shapes (UUIDs, prefixed IDs) before applying PII patterns, and add tests asserting that IDs and metric names pass through unchanged.
