Fix log link

This commit is contained in:
Seth Call 2025-12-18 21:34:00 -06:00
parent 1e0ed9dfea
commit 7ea45342d9
1 changed files with 4 additions and 3 deletions

View File

@ -45,10 +45,11 @@ spec:
pipelineStages:
- cri: {}
- regex:
# Matches: [14.12.2025 17:53.42.010] [LOG] message...
expression: '^\[.*\] \[(?P<level>\w+)\]\s+(?P<message>.*)$'
# Capture into a temporary variable 'raw_level' to avoid overwriting existing logic
expression: '^\[.*\] \[(?P<raw_level>\w+)\]\s+(?P<message>.*)$'
- template:
source: level
template: '{{ "{{" }} if eq .Value "LOG" {{ "}}" }}info{{ "{{" }} else if eq .Value "WARN" {{ "}}" }}warn{{ "{{" }} else if eq .Value "ERROR" {{ "}}" }}error{{ "{{" }} else {{ "}}" }}{{ "{{" }} .Value | lower {{ "}}" }}{{ "{{" }} end {{ "}}" }}'
# If raw_level exists (regex matched), map it. Otherwise, default to 'info'.
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 .Extraction.raw_level {{ "}}" }}{{ "{{" }} .Extraction.raw_level | lower {{ "}}" }}{{ "{{" }} else {{ "}}" }}info{{ "{{" }} end {{ "}}" }}'
- labels:
level: level