From: Eric Leblond Date: Tue, 18 Nov 2014 10:07:59 +0000 (+0100) Subject: output-json-http: output status as an integer X-Git-Tag: suricata-2.1beta4~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=268285c49f2ab2141c9217cc21aeffbf366cb555;p=thirdparty%2Fsuricata.git output-json-http: output status as an integer 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. --- diff --git a/src/output-json-http.c b/src/output-json-http.c index b5a63bf294..bef5335f2d 100644 --- a/src/output-json-http.c +++ b/src/output-json-http.c @@ -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); }