Skip to content

How to map ServerityNumber to ServerityText? #35890

Closed Answered by Wudadada
Wudadada asked this question in Q&A
Discussion options

You must be logged in to vote

it works with the follow config
processors:
batch:
timeout: 5s
send_batch_size: 100000
transform:
log_statements:

  • context: log
    statements:
  • set(severity_text, "INFO") where IsString(body) and IsMatch(body, "\tinfo\t")
  • set(severity_text, "WARN") where IsString(body) and IsMatch(body, "\twarn\t")
  • set(severity_text, "ERROR") where IsString(body) and IsMatch(body, "\terror\t")
  • set(severity_text, "TRACE") where severity_number == 1
  • set(severity_text, "DEBUG") where severity_number == 5
  • set(severity_text, "INFO") where severity_number == 9
  • set(severity_text, "WARN") where severity_number == 13
  • set(severity_text, "ERROR") where severity_number == 17
  • set(severity_text, "FATAL") where severity_num…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Wudadada
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant