]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
profiling: Make rule_perf.log JSON output newline-delimited
authorSimeon Miteff <simeon.miteff@corelight.com>
Wed, 28 Sep 2022 23:38:07 +0000 (09:38 +1000)
committerVictor Julien <vjulien@oisf.net>
Fri, 28 Oct 2022 10:07:11 +0000 (12:07 +0200)
Adding a newline makes the output valid JSON when multiple sortings of
the rules profile object are written to the log.

src/util-profiling-rules.c

index 2303a513265ba7fda3fac05e985a6c3b3fc783ea..c221de6901f33adffe2a56e3d95a3b92efae7486 100644 (file)
@@ -340,7 +340,7 @@ static void DumpJson(FILE *fp, SCProfileSummary *summary,
 
     if (unlikely(js_s == NULL))
         return;
-    fprintf(fp, "%s", js_s);
+    fprintf(fp, "%s\n", js_s);
     free(js_s);
     json_decref(js);
 }