From: Eric Urban Date: Mon, 12 Nov 2018 18:38:50 +0000 (-0600) Subject: debug/log: add log level for JSON type X-Git-Tag: suricata-4.1.1~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90a0731564d7b133a252a823911aa43a534ab7d2;p=thirdparty%2Fsuricata.git debug/log: add log level for JSON type resolves #2671 --- diff --git a/src/util-debug.c b/src/util-debug.c index b72edf3d2a..40c9fc0a0f 100644 --- a/src/util-debug.c +++ b/src/util-debug.c @@ -222,6 +222,13 @@ static int SCLogMessageJSON(struct timeval *tval, char *buffer, size_t buffer_si CreateIsoTimeString(tval, timebuf, sizeof(timebuf)); json_object_set_new(js, "timestamp", json_string(timebuf)); + const char *s = SCMapEnumValueToName(log_level, sc_log_level_map); + if (s != NULL) { + json_object_set_new(js, "log_level", json_string(s)); + } else { + json_object_set_new(js, "log_level", json_string("INVALID")); + } + json_object_set_new(js, "event_type", json_string("engine")); if (error_code > 0) {