]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output/tftp: Include common options 5140/head
authorJeff Lucovsky <jeff@lucovsky.org>
Mon, 29 Jun 2020 13:48:20 +0000 (09:48 -0400)
committerJeff Lucovsky <jeff@lucovsky.org>
Sun, 5 Jul 2020 18:02:54 +0000 (14:02 -0400)
This commit will cause common metadata values and the community id to be
included in log output when configured.

(cherry picked from commit 0bb62e0abb0b4956e71b232c4e4094fa2545e1f9)

src/output-json-tftp.c

index ed6b73c35ebc42ae3c5c4d44b35dad6264837731..777d3129d8a7d0c49ab8913bafeac1d161070c90 100644 (file)
@@ -58,6 +58,7 @@
 typedef struct LogTFTPFileCtx_ {
     LogFileCtx *file_ctx;
     uint32_t    flags;
+    OutputJsonCommonSettings cfg;
 } LogTFTPFileCtx;
 
 typedef struct LogTFTPLogThread_ {
@@ -83,6 +84,7 @@ static int JsonTFTPLogger(ThreadVars *tv, void *thread_data,
 
     json_object_set_new(js, "tftp", tftpjs);
 
+    JsonAddCommonOptions(&thread->tftplog_ctx->cfg, p, f, js);
     MemBufferReset(thread->buffer);
     OutputJSONBuffer(js, thread->tftplog_ctx->file_ctx, &thread->buffer);
 
@@ -112,6 +114,7 @@ static OutputInitResult OutputTFTPLogInitSub(ConfNode *conf,
         return result;
     }
     tftplog_ctx->file_ctx = ajt->file_ctx;
+    tftplog_ctx->cfg = ajt->cfg;
 
     OutputCtx *output_ctx = SCCalloc(1, sizeof(*output_ctx));
     if (unlikely(output_ctx == NULL)) {