]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output/dhcp: Include common output options
authorJeff Lucovsky <jeff@lucovsky.org>
Mon, 29 Jun 2020 13:50:53 +0000 (09:50 -0400)
committerJeff Lucovsky <jeff@lucovsky.org>
Sun, 5 Jul 2020 15:40:54 +0000 (11:40 -0400)
This commit will cause common metadata values and the community id to be
included in log output when configured.

(cherry picked from commit 7a939ae9c237b17b31afd3bf91dfa1701be882ea)

src/output-json-dhcp.c

index e715de193a4d5ca5a23c2fbaee00fed68deb31c5..bf1944a8731c4b87997e76a8cc21eaa04c1b0d4d 100644 (file)
@@ -51,6 +51,7 @@ typedef struct LogDHCPFileCtx_ {
     LogFileCtx *file_ctx;
     uint32_t    flags;
     void       *rs_logger;
+    OutputJsonCommonSettings cfg;
 } LogDHCPFileCtx;
 
 typedef struct LogDHCPLogThread_ {
@@ -76,6 +77,7 @@ static int JsonDHCPLogger(ThreadVars *tv, void *thread_data,
     }
     json_object_set_new(js, "dhcp", dhcp_js);
 
+    JsonAddCommonOptions(&thread->dhcplog_ctx->cfg, p, f, js);
     MemBufferReset(thread->buffer);
     OutputJSONBuffer(js, thread->dhcplog_ctx->file_ctx, &thread->buffer);
     json_decref(js);
@@ -106,6 +108,7 @@ static OutputInitResult OutputDHCPLogInitSub(ConfNode *conf,
         return result;
     }
     dhcplog_ctx->file_ctx = ajt->file_ctx;
+    dhcplog_ctx->cfg = ajt->cfg;
 
     OutputCtx *output_ctx = SCCalloc(1, sizeof(*output_ctx));
     if (unlikely(output_ctx == NULL)) {