From: Victor Julien Date: Thu, 18 Feb 2021 14:03:47 +0000 (+0100) Subject: detect/analyzer: use rule style pretty print for patterns X-Git-Tag: suricata-7.0.0-beta1~1488 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22dfcc928c88e56c17610d8a13a7ea868230719f;p=thirdparty%2Fsuricata.git detect/analyzer: use rule style pretty print for patterns --- diff --git a/src/detect-engine-analyzer.c b/src/detect-engine-analyzer.c index 0f7a1506ce..9e5037d576 100644 --- a/src/detect-engine-analyzer.c +++ b/src/detect-engine-analyzer.c @@ -610,7 +610,10 @@ static bool LooksLikeHTTPUA(const uint8_t *buf, uint16_t len) static void DumpContent(JsonBuilder *js, const DetectContentData *cd) { - jb_set_string_from_bytes(js, "pattern", cd->content, cd->content_len); + char pattern_str[1024] = ""; + DetectContentPatternPrettyPrint(cd, pattern_str, sizeof(pattern_str)); + + jb_set_string(js, "pattern", pattern_str); jb_set_uint(js, "length", cd->content_len); jb_set_bool(js, "nocase", cd->flags & DETECT_CONTENT_NOCASE); jb_set_bool(js, "negated", cd->flags & DETECT_CONTENT_NEGATED);