]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
eve/drop: log direction if we have a flow
authorVictor Julien <vjulien@oisf.net>
Wed, 19 Oct 2022 12:29:05 +0000 (12:29 +0000)
committerVictor Julien <vjulien@oisf.net>
Thu, 20 Oct 2022 05:23:12 +0000 (07:23 +0200)
src/output-json-drop.c

index 19a692e73bb0a9708c1b36ba569ddb85e04a9b39..1177c326079c95635f5a36dee366fb822fe7e5d3 100644 (file)
@@ -93,6 +93,14 @@ static int DropLogJSON (JsonDropLogThread *aft, const Packet *p)
     if (unlikely(js == NULL))
         return TM_ECODE_OK;
 
+    if (p->flow != NULL) {
+        if (p->flowflags & FLOW_PKT_TOSERVER) {
+            jb_set_string(js, "direction", "to_server");
+        } else {
+            jb_set_string(js, "direction", "to_client");
+        }
+    }
+
     jb_open_object(js, "drop");
 
     uint16_t proto = 0;