I want to replace level filed value by output message "levelName" 's value. Is it possible to do this in logstash conf?
filter {
if [fields][level] == "default" {
grok {
match => {"message" => ["(?m)%{TIMESTAMP_ISO8601:timestamp}\|%{NOTSPACE:orgCode}\|%{NOTSPACE:traceId}\|%{WORD:levelName}\|%{NOTSPACE:logger}\|%{GREEDYDATA:message}"]}
}
}
mutate {
lowercase => ["level"]
replace => [ "level", %{level} ]
}
}
above conf is invalid according to logstash