Extracting HAProxy JSON logs inside syslog/journald #24536
-
QuestionWe're generating JSON formatted logs from HAProxy which will send to syslog / journald and are then collected by Vector. I'm trying to build a Vector configuration which can extract the fields from the JSON formatted log line and having difficulty. The config so far will successfully parse the syslog and remove the syslog parts, leaving only the JSON log as a string inside a Vector ConfigVector Logs |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
This output is not really json and there is no function we provide that would support this natively. The good news is that you can configure HAProxy 3.0+ to output actual json by using the |
Beta Was this translation helpful? Give feedback.
This output is not really json and there is no function we provide that would support this natively. The good news is that you can configure HAProxy 3.0+ to output actual json by using the
%{+json}oprefix in log-format. Look for+jsonin this article https://www.haproxy.com/blog/encoding-haproxy-logs-in-machine-readable-json-or-cbor. You should be able to useparse_jsonafter this is properly configured