From: Jeff Lucovsky Date: Mon, 29 Jun 2020 13:48:20 +0000 (-0400) Subject: output/tftp: Include common options X-Git-Tag: suricata-5.0.4~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b86c7dc3f4167f9bcfe8f53aa4b892c43e663a2;p=thirdparty%2Fsuricata.git output/tftp: Include common options This commit will cause common metadata values and the community id to be included in log output when configured. (cherry picked from commit 0bb62e0abb0b4956e71b232c4e4094fa2545e1f9) --- diff --git a/src/output-json-tftp.c b/src/output-json-tftp.c index 94f5b05e94..c9352948e0 100644 --- a/src/output-json-tftp.c +++ b/src/output-json-tftp.c @@ -54,6 +54,7 @@ typedef struct LogTFTPFileCtx_ { LogFileCtx *file_ctx; uint32_t flags; + OutputJsonCommonSettings cfg; } LogTFTPFileCtx; typedef struct LogTFTPLogThread_ { @@ -79,6 +80,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); @@ -108,6 +110,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)) {