test
This commit is contained in:
parent
7fb58eb5e5
commit
3210848d8c
|
|
@ -46,11 +46,11 @@ spec:
|
|||
- cri: {}
|
||||
- regex:
|
||||
# Capture into a temporary variable 'raw_level' to avoid overwriting existing logic
|
||||
# Matches: [LEVEL] anywhere in the line
|
||||
expression: '\[(?P<raw_level>DEBUG|INFO|WARN|ERROR|LOG|TRACE)\]'
|
||||
# Matches: [LEVEL] anywhere in the line, allowing for whitespace
|
||||
expression: '\[\s*(?P<raw_level>DEBUG|INFO|WARN|ERROR|LOG|TRACE)\s*\]'
|
||||
- template:
|
||||
source: level
|
||||
# If raw_level exists (regex matched), map it. Otherwise, default to 'info'.
|
||||
template: 'debug'
|
||||
# If raw_level exists (regex matched), map it. Otherwise, default to 'unknown' to verify config application.
|
||||
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 .Extraction.raw_level {{ "}}" }}{{ "{{" }} .Extraction.raw_level | lower {{ "}}" }}{{ "{{" }} else {{ "}}" }}unknown{{ "{{" }} end {{ "}}" }}'
|
||||
- labels:
|
||||
level: level
|
||||
|
|
|
|||
Loading…
Reference in New Issue