From 790ce3743ba7edb9686bc0906b3075640d26331b Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Mon, 11 Dec 2017 15:50:36 -0600 Subject: [PATCH] eve: flow: global metadata config --- src/output-json-flow.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/output-json-flow.c b/src/output-json-flow.c index dee2f6ff5a..47516d6413 100644 --- a/src/output-json-flow.c +++ b/src/output-json-flow.c @@ -54,6 +54,7 @@ typedef struct LogJsonFileCtx_ { LogFileCtx *file_ctx; uint32_t flags; /** Store mode */ + bool include_metadata; } LogJsonFileCtx; typedef struct JsonFlowLogThread_ { @@ -208,9 +209,7 @@ void JsonAddFlow(Flow *f, json_t *js, json_t *hjs) /* JSON format logging */ static void JsonFlowLogJSON(JsonFlowLogThread *aft, json_t *js, Flow *f) { -#if 0 LogJsonFileCtx *flow_ctx = aft->flowlog_ctx; -#endif json_t *hjs = json_object(); if (hjs == NULL) { return; @@ -272,6 +271,9 @@ static void JsonFlowLogJSON(JsonFlowLogThread *aft, json_t *js, Flow *f) json_object_set_new(js, "flow", hjs); + if (flow_ctx->include_metadata) { + JsonAddMetadata(NULL, f, js); + } /* TCP */ if (f->proto == IPPROTO_TCP) { @@ -436,6 +438,7 @@ static OutputInitResult OutputFlowLogInitSub(ConfNode *conf, OutputCtx *parent_c } flow_ctx->file_ctx = ojc->file_ctx; + flow_ctx->include_metadata = ojc->include_metadata; output_ctx->data = flow_ctx; output_ctx->DeInit = OutputFlowLogDeinitSub;