Rsyslog - How can I parse json message and use as variable in if condition

Viewed 97

My application is sending log which is json-formatted (nested) to rsyslog via UDP like below.

{"http": {"status_code": 400}}

I want to parse this log and use property as a variable in if condition like in rsyslog conf.

if ($!http!status_code >= 400) then {
    /var/log/haproxy/haproxy-traffic-error.log
    stop
}

Is this possible? This issue is making me crazy now. I have looked for many articles about mmjsonparse, mmnormalize and etc...

0 Answers
Related