]> git.ipfire.org Git - thirdparty/suricata.git/commit
output/json: check 5-tuple values prior to logging
authorGiuseppe Longo <giuseppe@glongo.it>
Wed, 20 Mar 2024 17:31:42 +0000 (18:31 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 16 May 2024 05:09:27 +0000 (07:09 +0200)
commita1c6328156ffa1e3d690fa180b0395f9dcd9f52e
treeb4c8b030c01588f13e11e1848acb1bb43c48644c
parent987a27923dfd61496651b32ec814d7e5cda08774
output/json: check 5-tuple values prior to logging

This commit enhances the JSON output by introducing a feature for conditional port logging.
Now, port logging is dependent on the underlying protocol
(such as TCP, UDP, or SCTP), where port information is pertinent, while it
avoids unnecessary logging for protocols where a port is not utilized (e.g. ARP).

Furthermore, this update ensures that IP addresses and the protocol have
meaningful values set, rather than being logged as empty strings.

These changes will make each log entry more precise, eliminating cases where
5-tuple fields are empty or set to zero, indicating the absence of a field.
src/output-json.c
src/output-json.h