]> git.ipfire.org Git - people/ms/suricata.git/commitdiff
detect/analyzer: use rule style pretty print for patterns
authorVictor Julien <victor@inliniac.net>
Thu, 18 Feb 2021 14:03:47 +0000 (15:03 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 1 Sep 2021 06:33:52 +0000 (08:33 +0200)
src/detect-engine-analyzer.c

index 0f7a1506ce4f67e98b3b13a682cb0e81349f834b..9e5037d57654bd4572e22ec81785020c17bb9470 100644 (file)
@@ -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);