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

index fe0b8d491c77dfacfe6071af51057eb7eaa2b5dd..0e44c18967d763f86bd359e920e8a3e92826d7a0 100644 (file)
@@ -54,6 +54,7 @@
 typedef struct LogNFSFileCtx_ {
     LogFileCtx *file_ctx;
     uint32_t    flags;
+    bool        include_metadata;
 } LogNFSFileCtx;
 
 typedef struct LogNFSLogThread_ {
@@ -103,6 +104,10 @@ static int JsonNFSLogger(ThreadVars *tv, void *thread_data,
         return TM_ECODE_FAILED;
     }
 
+    if (thread->nfslog_ctx->include_metadata) {
+        JsonAddMetadata(p, f, js);
+    }
+
     json_t *rpcjs = rs_rpc_log_json_response(tx);
     if (unlikely(rpcjs == NULL)) {
         goto error;
@@ -144,6 +149,7 @@ static OutputInitResult OutputNFSLogInitSub(ConfNode *conf,
         return result;
     }
     nfslog_ctx->file_ctx = ajt->file_ctx;
+    nfslog_ctx->include_metadata = ajt->include_metadata;
 
     OutputCtx *output_ctx = SCCalloc(1, sizeof(*output_ctx));
     if (unlikely(output_ctx == NULL)) {