From d030ea7f29100f6d3c789efaf4aeb4fb020ebf21 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Tue, 7 Apr 2026 11:18:45 +0200 Subject: [PATCH] output: rename reject-target to reject_target Ticket: 6502 Forbid dashes in json keys for better use by processing tools --- doc/userguide/output/eve/eve-json-format.rst | 2 +- doc/userguide/upgrade.rst | 2 ++ etc/schema.json | 2 +- src/output-json-alert.c | 6 +++--- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/userguide/output/eve/eve-json-format.rst b/doc/userguide/output/eve/eve-json-format.rst index acba750fb7..c5569c852f 100644 --- a/doc/userguide/output/eve/eve-json-format.rst +++ b/doc/userguide/output/eve/eve-json-format.rst @@ -487,7 +487,7 @@ Example: "verdict": { "action": "drop", - "reject-target": "to_client", + "reject_target": "to_client", "reject": "[icmp-prohib]" } diff --git a/doc/userguide/upgrade.rst b/doc/userguide/upgrade.rst index 70619367c1..e66dc70aa6 100644 --- a/doc/userguide/upgrade.rst +++ b/doc/userguide/upgrade.rst @@ -55,6 +55,8 @@ Logging Changes E.g., previously, ``ether_type`` values were logged in host order; an ethertype value of ``0xfbb7`` (network order) was logged as `47099`` (``0xb7fb``). This ethertype value will be logged as ``64439``. +- Alert verdict key is changed from to ``reject-target`` to ``reject_target`` + Other Changes ~~~~~~~~~~~~~ - ``engine-analysis`` output has been changed for keywords that now use the generic integers framework diff --git a/etc/schema.json b/etc/schema.json index 44aa69f6c3..c13808ce16 100644 --- a/etc/schema.json +++ b/etc/schema.json @@ -9081,7 +9081,7 @@ ] } }, - "reject-target": { + "reject_target": { "type": "string", "oneOf": [ { diff --git a/src/output-json-alert.c b/src/output-json-alert.c index db87622120..d0e6dba094 100644 --- a/src/output-json-alert.c +++ b/src/output-json-alert.c @@ -554,11 +554,11 @@ void EveAddVerdict(SCJsonBuilder *jb, const Packet *p, const uint8_t alert_actio JB_SET_STRING(jb, "action", "alert"); } if (packet_action & ACTION_REJECT) { - JB_SET_STRING(jb, "reject-target", "to_client"); + JB_SET_STRING(jb, "reject_target", "to_client"); } else if (packet_action & ACTION_REJECT_DST) { - JB_SET_STRING(jb, "reject-target", "to_server"); + JB_SET_STRING(jb, "reject_target", "to_server"); } else if (packet_action & ACTION_REJECT_BOTH) { - JB_SET_STRING(jb, "reject-target", "both"); + JB_SET_STRING(jb, "reject_target", "both"); } SCJbOpenArray(jb, "reject"); switch (p->proto) {