Skip to content

Proposal: Support configuring rule.Reason as a Sprintf format string #1067

@jessehu

Description

@jessehu

Hi folks, I'd like to make a proposal to support configuring rule.Reason as a Sprintf format string and formatting it with the matched capturing groups in rule.Pattern. This feature can support the case when a pattern can match multi reasons. For example, there are many kind of Nvidia GPU Xid errors in dmesg log. We can defined a reason string "NvidiaGPUXid%s" and use the matched Xid 31/45/79 to replace "%s" in the reason, so no need to define a dedicated reason for each Xid error.

"NVRM: Xid (PCI:0000:9A:00.0): 31, Ch 00000010"
"NVRM: Xid (PCI:0000:9A:00.0): 45, Ch 00000010"
"NVRM: Xid (PCI:0000:9A:00.0): 79, Ch 00000010"

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions