]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
datajson: output context to "context"
authorEric Leblond <el@stamus-networks.com>
Tue, 29 Apr 2025 08:51:23 +0000 (10:51 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 11 Jun 2025 18:49:18 +0000 (20:49 +0200)
Using `alert.extra` was not really reflecting the nature of what
was added. So renaming it to `alert.context`.

etc/schema.json
src/output-json-alert.c

index 8846ab48724e9ac8bf2916ebf2137e6751ee2085..d3a1f65e98d14bbaf3b5346b0a76e93376c722dc 100644 (file)
                 "gid": {
                     "type": "integer"
                 },
-                "extra": {
+                "context": {
                     "type": "object",
                     "additionalProperties": true,
-                    "description": "Extra data created by keywords such as dataset with JSON"
+                    "description": "Extra context data created by keywords such as dataset with JSON"
                 },
                 "metadata": {
                     "type": "object",
                             }
                         },
                         "additionalProperties": true
-                    },
-                },
+                    }
+                }
             },
             "optional": true
         },
index 003e3f56c5e803e25f5776f8f350aa16018de1b6..597e2f99b8f8a506a3e01dbf39eccb8470496599 100644 (file)
@@ -254,7 +254,7 @@ void AlertJsonHeader(const Packet *p, const PacketAlert *pa, SCJsonBuilder *js,
     }
 
     if (pa->json_info.json_string != NULL) {
-        SCJbOpenObject(js, "extra");
+        SCJbOpenObject(js, "context");
         const struct ExtraDataJsonList *json_info = &pa->json_info;
         while (json_info) {
             SCJbSetFormatted(js, json_info->json_string);