eve: flow: global metadata config

pull/3201/head
Jason Ish 8 years ago committed by Victor Julien
parent 23bbbc5818
commit 790ce3743b

@ -54,6 +54,7 @@
typedef struct LogJsonFileCtx_ { typedef struct LogJsonFileCtx_ {
LogFileCtx *file_ctx; LogFileCtx *file_ctx;
uint32_t flags; /** Store mode */ uint32_t flags; /** Store mode */
bool include_metadata;
} LogJsonFileCtx; } LogJsonFileCtx;
typedef struct JsonFlowLogThread_ { typedef struct JsonFlowLogThread_ {
@ -208,9 +209,7 @@ void JsonAddFlow(Flow *f, json_t *js, json_t *hjs)
/* JSON format logging */ /* JSON format logging */
static void JsonFlowLogJSON(JsonFlowLogThread *aft, json_t *js, Flow *f) static void JsonFlowLogJSON(JsonFlowLogThread *aft, json_t *js, Flow *f)
{ {
#if 0
LogJsonFileCtx *flow_ctx = aft->flowlog_ctx; LogJsonFileCtx *flow_ctx = aft->flowlog_ctx;
#endif
json_t *hjs = json_object(); json_t *hjs = json_object();
if (hjs == NULL) { if (hjs == NULL) {
return; return;
@ -272,6 +271,9 @@ static void JsonFlowLogJSON(JsonFlowLogThread *aft, json_t *js, Flow *f)
json_object_set_new(js, "flow", hjs); json_object_set_new(js, "flow", hjs);
if (flow_ctx->include_metadata) {
JsonAddMetadata(NULL, f, js);
}
/* TCP */ /* TCP */
if (f->proto == IPPROTO_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->file_ctx = ojc->file_ctx;
flow_ctx->include_metadata = ojc->include_metadata;
output_ctx->data = flow_ctx; output_ctx->data = flow_ctx;
output_ctx->DeInit = OutputFlowLogDeinitSub; output_ctx->DeInit = OutputFlowLogDeinitSub;

Loading…
Cancel
Save