From b1eec13907771b09aa0943df9b3fac10e1c7eca2 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Fri, 16 Jan 2026 16:15:03 -0600 Subject: [PATCH] log level --- k8s/loki/templates/podlogs.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/k8s/loki/templates/podlogs.yaml b/k8s/loki/templates/podlogs.yaml index ac22f57..35396d4 100644 --- a/k8s/loki/templates/podlogs.yaml +++ b/k8s/loki/templates/podlogs.yaml @@ -46,11 +46,11 @@ spec: - cri: {} - regex: # Capture into a temporary variable 'raw_level' to avoid overwriting existing logic - # Matches any of the keywords anywhere in the line, potentially surrounded by ANSI codes/junk + # Matches any of the keywords anywhere in the line expression: '(?PDEBUG|INFO|WARN|ERROR|LOG|TRACE)' - template: source: level - # Use contains logic to match the extracted level keyword - template: '{{ "{{" }} if contains .Extraction.raw_level "ERROR" {{ "}}" }}error{{ "{{" }} else if contains .Extraction.raw_level "WARN" {{ "}}" }}warn{{ "{{" }} else if contains .Extraction.raw_level "DEBUG" {{ "}}" }}debug{{ "{{" }} else if contains .Extraction.raw_level "TRACE" {{ "}}" }}trace{{ "{{" }} else if .Extraction.raw_level {{ "}}" }}info{{ "{{" }} else {{ "}}" }}unknown{{ "{{" }} end {{ "}}" }}' + # Use simple equality check on the extracted keyword + template: '{{ "{{" }} if eq .Extraction.raw_level "LOG" {{ "}}" }}info{{ "{{" }} else if eq .Extraction.raw_level "WARN" {{ "}}" }}warn{{ "{{" }} else if eq .Extraction.raw_level "ERROR" {{ "}}" }}error{{ "{{" }} else if eq .Extraction.raw_level "DEBUG" {{ "}}" }}debug{{ "{{" }} else if eq .Extraction.raw_level "TRACE" {{ "}}" }}trace{{ "{{" }} else if .Extraction.raw_level {{ "}}" }}{{ "{{" }} .Extraction.raw_level | lower {{ "}}" }}{{ "{{" }} else {{ "}}" }}info{{ "{{" }} end {{ "}}" }}' - labels: level: level