Skip to content

Commit

Permalink
Add missing delimiter for JSON output
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TiceDB authored Oct 18, 2024
1 parent 04cc2b8 commit 6825cb0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/output/output_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
} // End of flow_record_to_json

0 comments on commit 6825cb0

Please sign in to comment.