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/include/proto/log.h b/include/proto/log.h
index fca7fdd..62b39ea 100644
--- a/include/proto/log.h
+++ b/include/proto/log.h
@@ -43,9 +43,12 @@
extern char default_host_tag_pid_log_format[];
extern char rfc5424_host_tag_pid_log_format[];
+extern char default_rfc5424_sd_log_format[];
+
extern char *logheader;
extern char *logheader_rfc5424;
extern char *logline;
+extern char *logline_rfc5424;
int build_logline(struct stream *s, char *dst, size_t maxsize, struct list *list_format);
@@ -111,7 +114,7 @@
* It doesn't care about errors nor does it report them.
*/
-void __send_log(struct proxy *p, int level, char *message, size_t size);
+void __send_log(struct proxy *p, int level, char *message, size_t size, char *sd, size_t sd_size);
/*
* returns log format for <fmt> or -1 if not found.