Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions plugins/out_stdout/stdout.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,32 @@ static void print_metrics_text(struct flb_output_instance *ins,
size_t off = 0;
cfl_sds_t text;
struct cmt *cmt = NULL;
int ok = CMT_DECODE_MSGPACK_SUCCESS;

/* get cmetrics context */
ret = cmt_decode_msgpack_create(&cmt, (char *) data, bytes, &off);
if (ret != 0) {
flb_plg_error(ins, "could not process metrics payload");
return;
}
while((ret = cmt_decode_msgpack_create(&cmt,
(char *) data,
bytes, &off)) == ok) {
if (ret != 0) {
flb_plg_error(ins, "could not process metrics payload");
return;
}

/* convert to text representation */
text = cmt_encode_text_create(cmt);
/* convert to text representation */
text = cmt_encode_text_create(cmt);

/* destroy cmt context */
cmt_destroy(cmt);
/* destroy cmt context */
cmt_destroy(cmt);

printf("%s", text);
fflush(stdout);
printf("%s", text);
fflush(stdout);

cmt_encode_text_destroy(text);
}

cmt_encode_text_destroy(text);
if (ret != ok) {
flb_plg_debug(ins, "cmt decode msgpack returned : %d", ret);
}
}
#endif

Expand Down