]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
exceptions: move app_layer stats to common counter
authorJuliana Fajardini <jufajardini@oisf.net>
Mon, 24 Mar 2025 19:03:33 +0000 (12:03 -0700)
committerVictor Julien <victor@inliniac.net>
Tue, 1 Apr 2025 08:17:01 +0000 (10:17 +0200)
Part of making the exception policy stats counters more search
friendly.

Task #7185

etc/schema.json
src/app-layer.c

index 0bf065684d19532d30392131d262ea3faa49b421..b1736ce241c345a0120dff36bb7aa01a77b70f88 100644 (file)
                         "error": {
                             "type": "object",
                             "properties": {
-                                "exception_policy": {
-                                    "description":
-                                            "Consolidated stats on how many times app-layer error exception policy was applied, and which one",
-                                    "$ref": "#/$defs/exceptionPolicy"
-                                },
                                 "bittorrent-dht": {
                                     "description":
                                             "Errors encountered parsing BitTorrent DHT protocol",
                     },
                     "additionalProperties": false
                 },
+                "exception_policy": {
+                    "type": "object",
+                    "properties": {
+                        "app_layer": {
+                            "type": "object",
+                            "error": {
+                                "description":
+                                    "Consolidated stats on how many times app-layer error exception policy was applied, and which one",
+                                "$ref": "#/$defs/exceptionPolicy"
+                            }
+                        }
+                    }
+                },
                 "file_store": {
                     "type": "object",
                     "properties": {
index e65334873029641202c0d78d1eb21739c2e3d8ce..d06983f7db36336ef267fa603439c4c5d8201a40 100644 (file)
@@ -1213,7 +1213,7 @@ void AppLayerSetupCounters(void)
     /* We don't log stats counters if exception policy is `ignore`/`not set` */
     if (g_applayerparser_error_policy != EXCEPTION_POLICY_NOT_SET) {
         /* Register global counters for app layer error exception policy summary */
-        const char *eps_default_str = "app_layer.error.exception_policy.";
+        const char *eps_default_str = "exception_policy.app_layer.error.";
         for (enum ExceptionPolicy i = EXCEPTION_POLICY_NOT_SET + 1; i < EXCEPTION_POLICY_MAX; i++) {
             if (IsAppLayerErrorExceptionPolicyStatsValid(i)) {
                 snprintf(app_layer_error_eps_stats.eps_name[i],