From 6825cb0735bbd6db86c021bad53fc7b70c8baed9 Mon Sep 17 00:00:00 2001 From: TiceDB Date: Fri, 18 Oct 2024 09:50:43 +0200 Subject: [PATCH] Add missing delimiter for JSON output All JSON fields should have a comma delimiter. This is done by NDJSON but some of the JSON fields seem to be missing this comma. --- src/output/output_json.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/output/output_json.c b/src/output/output_json.c index 2e105ed7..26b5812a 100644 --- a/src/output/output_json.c +++ b/src/output/output_json.c @@ -451,10 +451,10 @@ static char *stringEXmacAddr(char *streamPtr, void *extensionRecord) { ptrdiff_t lenStream = STREAMLEN(streamPtr); int len = snprintf(streamPtr, lenStream, - " \"in_src_mac\" : \"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\"\n" - " \"out_dst_mac\" : \"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\"\n" - " \"in_dst_mac\" : \"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\"\n" - " \"out_src_mac\" : \"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\"\n", + " \"in_src_mac\" : \"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\",\n" + " \"out_dst_mac\" : \"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\",\n" + " \"in_dst_mac\" : \"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\",\n" + " \"out_src_mac\" : \"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\",\n", mac1[5], mac1[4], mac1[3], mac1[2], mac1[1], mac1[0], mac2[5], mac2[4], mac2[3], mac2[2], mac2[1], mac2[0], mac3[5], mac3[4], mac3[3], mac3[2], mac3[1], mac3[0], mac4[5], mac4[4], mac4[3], mac4[2], mac4[1], mac4[0]); streamPtr += len; @@ -964,4 +964,4 @@ void flow_record_to_json(FILE *stream, recordHandle_t *recordHandle, int tag) { fputs(streamBuff, stream); -} // End of flow_record_to_json \ No newline at end of file +} // End of flow_record_to_json