]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dhcp/eve: add common eve fields
authorJason Ish <jason.ish@oisf.net>
Wed, 4 Mar 2020 21:48:54 +0000 (15:48 -0600)
committerVictor Julien <victor@inliniac.net>
Wed, 3 Jun 2020 11:36:55 +0000 (13:36 +0200)
Add the common eve fields like metadata and community id.

src/output-json-dhcp.c

index dd12531d9a6ad3fc3ca9c277c465b2e53a8f9236..183d3d08f10357e2ab6d545b188185886f669c66 100644 (file)
@@ -50,6 +50,7 @@ typedef struct LogDHCPFileCtx_ {
     LogFileCtx *file_ctx;
     uint32_t    flags;
     void       *rs_logger;
+    OutputJsonCommonSettings cfg;
 } LogDHCPFileCtx;
 
 typedef struct LogDHCPLogThread_ {
@@ -73,6 +74,8 @@ static int JsonDHCPLogger(ThreadVars *tv, void *thread_data,
         return TM_ECODE_FAILED;
     }
 
+    EveAddCommonOptions(&thread->dhcplog_ctx->cfg, p, f, js);
+
     rs_dhcp_logger_log(ctx->rs_logger, tx, js);
     if (!jb_close(js)) {
         goto fail;
@@ -108,6 +111,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)) {