]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output-json-http: output status as an integer
authorEric Leblond <eric@regit.org>
Tue, 18 Nov 2014 10:07:59 +0000 (11:07 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 8 May 2015 09:37:12 +0000 (11:37 +0200)
HTTP status is an integer and it should be written as such in the
JSON events. This will allow to have improved matching in log
analysis tools.

src/output-json-http.c

index b5a63bf294d02f486096f36a5f08046de288492b..bef5335f2d603285df6c730c7b5ba9a4f8576d60 100644 (file)
@@ -327,7 +327,8 @@ void JsonHttpLogJSONExtended(json_t *js, htp_tx_t *tx)
     if (tx->response_status != NULL) {
         c = bstr_util_strdup_to_c(tx->response_status);
         if (c != NULL) {
-            json_object_set_new(js, "status", json_string(c));
+            unsigned int val = strtoul(c, NULL, 10);
+            json_object_set_new(js, "status", json_integer(val));
             SCFree(c);
         }