From 268285c49f2ab2141c9217cc21aeffbf366cb555 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Tue, 18 Nov 2014 11:07:59 +0100 Subject: [PATCH] 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. --- src/output-json-http.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); }