From: Victor Julien Date: Wed, 18 Mar 2020 14:27:34 +0000 (+0100) Subject: output/tx: implement filtering X-Git-Tag: suricata-6.0.0-beta1~191 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df272054512207d2033aaf03ce7b702528d8ceb3;p=thirdparty%2Fsuricata.git output/tx: implement filtering --- 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;