Skip to content

LogPattern.template is a first-seen snapshot, not the final Drain3 template #5

Description

@catinspace-au

Found while adding typed masking (#4). extract_patterns captures cluster.get_template() only when a cluster FIRST appears - before later lines widen slots to <*>. So the stored template for a cluster whose lines differ is the raw first line, never the wildcarded template Drain3 ends up with.

Two consequences:

  • consumers reading LogPattern.template (incl the DFE synthetic-data inversion) see a template with NO slots for clusters that genuinely vary
  • the <*>-count priority boost in _calculate_priority runs on the stale snapshot, so complex patterns are under-boosted

Fix is a one-liner shape (re-read cluster.get_template() after the feed loop) but it changes output for every existing consumer, so it wants its own change with eyes on the priority impact. Done when the stored template equals the live cluster template at extraction end and priorities are computed from it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions