MEDIUM: logs: add a new RFC5424 log-format for the structured-data
This patch adds a new RFC5424-specific log-format for the structured-data
that is automatically send by __send_log() when the sender is in RFC5424
mode.
A new statement "log-format-sd" should be used in order to set log-format
for the structured-data part in RFC5424 formatted syslog messages.
Example:
log-format-sd [exampleSDID@1234\ bytes=\"%B\"\ status=\"%ST\"]
diff --git a/src/haproxy.c b/src/haproxy.c
index 9539dfa..57db1db 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -1227,6 +1227,10 @@
free(p->conf.uif_file);
free(p->lbprm.map.srv);
+ if (p->conf.logformat_sd_string != default_rfc5424_sd_log_format)
+ free(p->conf.logformat_sd_string);
+ free(p->conf.lfsd_file);
+
for (i = 0; i < HTTP_ERR_SIZE; i++)
chunk_destroy(&p->errmsg[i]);
@@ -1336,6 +1340,11 @@
free(lf);
}
+ list_for_each_entry_safe(lf, lfb, &p->logformat_sd, list) {
+ LIST_DEL(&lf->list);
+ free(lf);
+ }
+
deinit_tcp_rules(&p->tcp_req.inspect_rules);
deinit_tcp_rules(&p->tcp_req.l4_rules);