]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output/tftp: Include common options
authorJeff Lucovsky <jeff@lucovsky.org>
Mon, 29 Jun 2020 13:48:20 +0000 (09:48 -0400)
committerVictor Julien <victor@inliniac.net>
Mon, 29 Jun 2020 18:02:40 +0000 (20:02 +0200)
This commit will cause common metadata values and the community id to be
included in log output when configured.

src/output-json-tftp.c

index 182962b8666cf2100c033bbf1e13f7d7e0a9ec4d..dbad0ae4e72f946585e65e145e45aaed9043bdd5 100644 (file)
@@ -53,6 +53,7 @@
 typedef struct LogTFTPFileCtx_ {
     LogFileCtx *file_ctx;
     uint32_t    flags;
+    OutputJsonCommonSettings cfg;
 } LogTFTPFileCtx;
 
 typedef struct LogTFTPLogThread_ {
@@ -78,6 +79,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);
 
@@ -107,6 +109,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)) {