From e9a3415fc2ad0ad73b574f0c84c2325a1145c993 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Wed, 4 Mar 2020 15:48:54 -0600 Subject: [PATCH] dhcp/eve: add common eve fields Add the common eve fields like metadata and community id. --- src/output-json-dhcp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/output-json-dhcp.c b/src/output-json-dhcp.c index dd12531d9a..183d3d08f1 100644 --- a/src/output-json-dhcp.c +++ b/src/output-json-dhcp.c @@ -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)) {