Skip to content

Commit d392cc9

Browse files
committed
Fixed duplicit record output before template entries in JSON plugin
1 parent b13b9e3 commit d392cc9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/plugins/output/json/src/Storage.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ Storage::convert_tset(struct ipx_ipfix_set *set, const struct fds_ipfix_msg_hdr
276276

277277
// Iteration through all (Options) Templates in the Set
278278
while (fds_tset_iter_next(&tset_iter) == FDS_OK) {
279+
// Buffer is empty
280+
m_record.size_used = 0;
281+
279282
// Read and print single template
280283
convert_tmplt_rec(&tset_iter, set_id, hdr);
281284

@@ -285,9 +288,6 @@ Storage::convert_tset(struct ipx_ipfix_set *set, const struct fds_ipfix_msg_hdr
285288
return IPX_ERR_DENIED;
286289
}
287290
}
288-
289-
// Buffer is empty
290-
m_record.size_used = 0;
291291
}
292292

293293
return IPX_OK;
@@ -453,4 +453,4 @@ Storage::convert(struct fds_drec &rec, const fds_iemgr_t *iemgr, fds_ipfix_msg_h
453453

454454
// Append the record with end of line character
455455
buffer_append("\n");
456-
}
456+
}

0 commit comments

Comments
 (0)