From: brianpkelly (no email) Date: Tue, 9 Jun 2015 18:52:54 +0000 (-0500) Subject: write_redis: Increase parsability of multi-valued keys by insterting delimiting chara... X-Git-Tag: collectd-5.5.1~116^2~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5c416628a579131d57e75f217bfb7845a66fe62f;p=collectd.git write_redis: Increase parsability of multi-valued keys by insterting delimiting characters --- diff --git a/src/write_redis.c b/src/write_redis.c index f2090167..61893ff3 100644 --- a/src/write_redis.c +++ b/src/write_redis.c @@ -87,6 +87,10 @@ static int wr_write (const data_set_t *ds, /* {{{ */ APPEND ("%.3f:", CDTIME_T_TO_DOUBLE (vl->time)); for (i = 0; i < ds->ds_num; i++) { + // Increase parsability by delimiting the individual values + if (ds->ds_num > 1 && i > 0) + APPEND ("%s", "|"); + if (ds->ds[i].type == DS_TYPE_COUNTER) APPEND ("%llu", vl->values[i].counter); else if (ds->ds[i].type == DS_TYPE_GAUGE)