summaryrefslogtreecommitdiffstats
path: root/src/plugins/influxdb-writer.c
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2018-06-18 16:51:16 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2018-07-10 23:41:15 +0200
commit2f2beb8029e3d7836eac748a667c4f0c4f61ee02 (patch)
treec8591f35e0589d9e8582641327133b91e3af4bf4 /src/plugins/influxdb-writer.c
parentfe866cb7d63dd26ef271157430f9a7b3635ce40d (diff)
Escape special characters according to influxDB doc
Change-Id: I22724b547033b40b3160c3bbe1b2141349a1ead2 Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'src/plugins/influxdb-writer.c')
-rw-r--r--src/plugins/influxdb-writer.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/plugins/influxdb-writer.c b/src/plugins/influxdb-writer.c
index dca5dab..c1f8abd 100644
--- a/src/plugins/influxdb-writer.c
+++ b/src/plugins/influxdb-writer.c
@@ -76,9 +76,9 @@ static size_t format_write_args(char* query, struct series_t* serie)
else
concatenate(query, it->key, ",");
if (json_object_is_type(it->value, json_type_string))
- concatenate(query, json_object_get_string(it->value), "=");
+ concatenate_str(query, json_object_get_string(it->value), "=");
else
- concatenate(query, json_object_to_json_string(it->value), "=");
+ concatenate_str(query, json_object_to_json_string(it->value), "=");
i++;
}
}
@@ -165,8 +165,7 @@ CTLP_CAPI(write_to_influxdb, source, argsJ, eventJ)
if (wrap_json_unpack(req_args, "{s?s,s?o,so!}",
"host", &host,
"port", &portJ,
- "metric", &metric)
- || !metric)
+ "metric", &metric) || !metric)
AFB_ReqFail(request, "Failed", "Error processing arguments. Miss metric\
JSON object or malformed");
else