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/sample.c b/src/sample.c
index c1d5bb5..5a79955 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -1103,16 +1103,17 @@
where = "in";
ctx = "sample fetch keyword";
switch (cur->ctx) {
- case ARGC_STK: where = "in stick rule in"; break;
- case ARGC_TRK: where = "in tracking rule in"; break;
- case ARGC_LOG: where = "in log-format string in"; break;
- case ARGC_HRQ: where = "in http-request header format string in"; break;
- case ARGC_HRS: where = "in http-response header format string in"; break;
- case ARGC_UIF: where = "in unique-id-format string in"; break;
- case ARGC_RDR: where = "in redirect format string in"; break;
- case ARGC_CAP: where = "in capture rule in"; break;
- case ARGC_ACL: ctx = "ACL keyword"; break;
- case ARGC_SRV: where = "in server directive in"; break;
+ case ARGC_STK: where = "in stick rule in"; break;
+ case ARGC_TRK: where = "in tracking rule in"; break;
+ case ARGC_LOG: where = "in log-format string in"; break;
+ case ARGC_LOGSD: where = "in log-format-sd string in"; break;
+ case ARGC_HRQ: where = "in http-request header format string in"; break;
+ case ARGC_HRS: where = "in http-response header format string in"; break;
+ case ARGC_UIF: where = "in unique-id-format string in"; break;
+ case ARGC_RDR: where = "in redirect format string in"; break;
+ case ARGC_CAP: where = "in capture rule in"; break;
+ case ARGC_ACL: ctx = "ACL keyword"; break;
+ case ARGC_SRV: where = "in server directive in"; break;
}
/* set a few default settings */