Skip to main content

normalize_template

Function normalize_template 

Source
pub fn normalize_template(msg: &str) -> String
Expand description

Normalise a message into a template by replacing variable runs with placeholders.

Priority (highest first):

  1. JSON object/array — replace the whole value with <json>
  2. RFC 3164 timestamp prefix — replace leading Mon DD HH:MM:SS with <ts>
  3. UUID (8-4-4-4-12 hex) → <uuid>
  4. IPv4 / IPv4:port → <ip> / <ip>:<n>
  5. Long hex run (≥ 8 chars) → <hex>
  6. Quoted string (single or double, ≤ 200 chars) → <str>
  7. Linux absolute path (/…/…) → <path>
  8. Numeric run → <n>
  9. Non-ASCII codepoints pass through intact.