Skip to main content

Module detect

Module detect 

Source
Expand description

Format auto-detection.

Examines the first non-empty lines of file content to determine whether it uses CCM, Simple, Timestamped, or Plain text format. Normally samples 20 lines; when DNS path hints are detected, the sample window extends to 50 lines to look past the ~29-line DNS debug log header.

Detection strategy (matches CMTrace binary behavior, extended):

  • Check for <![LOG[ marker → CCM format
  • Check for $$< delimiter → Simple format
  • Check for Panther path hints plus Panther setup log records → dedicated Panther parser
  • Check for ReportingEvents path hints plus tab-delimited update history rows → dedicated ReportingEvents parser
  • Check for type=" substring → CCM format (fallback indicator)
  • Check for timestamp patterns (ISO, slash-date, syslog, time-only) → Timestamped
  • Otherwise → Plain text

Structs§

ResolvedParser
Backend-owned parser selection used for both initial parsing and tailing.

Functions§

detect_parser
Detect the parser selection from file content. Examines up to the first 20 non-empty lines.