From df272054512207d2033aaf03ce7b702528d8ceb3 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 18 Mar 2020 15:27:34 +0100 Subject: [PATCH] output/tx: implement filtering --- src/output-tx.c | 10 +++++++++- src/output.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/output-tx.c b/src/output-tx.c index 99ad08b915..6e35dcfbac 100644 --- a/src/output-tx.c +++ b/src/output-tx.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2007-2013 Open Information Security Foundation +/* Copyright (C) 2007-2020 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free @@ -209,6 +209,14 @@ static TmEcode OutputTxLog(ThreadVars *tv, Packet *p, void *thread_data) tx_id = ires.tx_id; AppLayerTxData *txd = AppLayerParserGetTxData(ipproto, alproto, tx); + if (txd) { + SCLogDebug("tx %p/%"PRIu64" txd %p: log_flags %x", tx, tx_id, txd, txd->config.log_flags); + if (txd->config.log_flags & BIT_U8(CONFIG_TYPE_TX)) { + SCLogDebug("SKIP tx %p/%"PRIu64, tx, tx_id); + goto next_tx; + } + } + if (list[ALPROTO_UNKNOWN] != 0) { OutputTxLogList0(tv, op_thread_data, p, f, tx, tx_id); if (list[alproto] == NULL) diff --git a/src/output.h b/src/output.h index 14bf4d61f9..fead6b5eab 100644 --- a/src/output.h +++ b/src/output.h @@ -38,6 +38,8 @@ #include "output-streaming.h" #include "output-stats.h" +#include "util-config.h" + typedef struct OutputInitResult_ { OutputCtx *ctx; bool ok; -- 2.47.2