]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output/tx: implement filtering
authorVictor Julien <victor@inliniac.net>
Wed, 18 Mar 2020 14:27:34 +0000 (15:27 +0100)
committerVictor Julien <victor@inliniac.net>
Sat, 11 Jul 2020 06:37:40 +0000 (08:37 +0200)
src/output-tx.c
src/output.h

index 99ad08b9152a81a61bd6ce8a493fa86233c3075e..6e35dcfbac4a7ae1d9299966d791951627c746d1 100644 (file)
@@ -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)
index 14bf4d61f97607661dcdc527e8f0cfd5f57330e2..fead6b5eaba5955872cf5b75b4fac9f5a4afab6d 100644 (file)
@@ -38,6 +38,8 @@
 #include "output-streaming.h"
 #include "output-stats.h"
 
+#include "util-config.h"
+
 typedef struct OutputInitResult_ {
     OutputCtx *ctx;
     bool ok;