From 22dfcc928c88e56c17610d8a13a7ea868230719f Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 18 Feb 2021 15:03:47 +0100 Subject: [PATCH] detect/analyzer: use rule style pretty print for patterns --- src/detect-engine-analyzer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 2.47.2