]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
eve: http: global metadata config
authorJason Ish <ish@unx.ca>
Mon, 11 Dec 2017 21:50:42 +0000 (15:50 -0600)
committerVictor Julien <victor@inliniac.net>
Tue, 30 Jan 2018 13:43:52 +0000 (14:43 +0100)
src/output-json-http.c

index bb60ce3e563746d736f5134f73bdee1cdcb94308..453e2011f466e56784b4f026611c5ff4fd654491 100644 (file)
@@ -58,6 +58,7 @@ typedef struct LogHttpFileCtx_ {
     LogFileCtx *file_ctx;
     uint32_t flags; /** Store mode */
     uint64_t fields;/** Store fields */
+    bool include_metadata;
 } LogHttpFileCtx;
 
 typedef struct JsonHttpLogThread_ {
@@ -455,6 +456,10 @@ static int JsonHttpLogger(ThreadVars *tv, void *thread_data, const Packet *p, Fl
     if (unlikely(js == NULL))
         return TM_ECODE_OK;
 
+    if (jhl->httplog_ctx->include_metadata) {
+        JsonAddMetadata(p, f, js);
+    }
+
     SCLogDebug("got a HTTP request and now logging !!");
 
     /* reset */
@@ -576,6 +581,7 @@ static OutputInitResult OutputHttpLogInitSub(ConfNode *conf, OutputCtx *parent_c
 
     http_ctx->file_ctx = ojc->file_ctx;
     http_ctx->flags = LOG_HTTP_DEFAULT;
+    http_ctx->include_metadata = ojc->include_metadata;
 
     if (conf) {
         const char *extended = ConfNodeLookupChildValue(conf, "extended");