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

index ffb781e06ac963a457318c47143c58a7e82db444..658777e4f7c06d6dba8c286c80fe0708bac74874 100644 (file)
@@ -57,6 +57,7 @@
 typedef struct OutputSshCtx_ {
     LogFileCtx *file_ctx;
     uint32_t flags; /** Store mode */
+    bool include_metadata;
 } OutputSshCtx;
 
 
@@ -109,6 +110,10 @@ static int JsonSshLogger(ThreadVars *tv, void *thread_data, const Packet *p,
     if (unlikely(js == NULL))
         return 0;
 
+    if (ssh_ctx->include_metadata) {
+        JsonAddMetadata(p, f, js);
+    }
+
     json_t *tjs = json_object();
     if (tjs == NULL) {
         free(js);
@@ -244,6 +249,7 @@ static OutputInitResult OutputSshLogInitSub(ConfNode *conf, OutputCtx *parent_ct
     }
 
     ssh_ctx->file_ctx = ojc->file_ctx;
+    ssh_ctx->include_metadata = ojc->include_metadata;
 
     output_ctx->data = ssh_ctx;
     output_ctx->DeInit = OutputSshLogDeinitSub;