summaryrefslogtreecommitdiffstats
path: root/src/plugins/influxdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/influxdb.c')
-rw-r--r--src/plugins/influxdb.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/plugins/influxdb.c b/src/plugins/influxdb.c
index b08eb9e..27161ab 100644
--- a/src/plugins/influxdb.c
+++ b/src/plugins/influxdb.c
@@ -80,7 +80,7 @@ int create_database()
void unpack_values(void *l, json_object *valuesJ, const char *key)
{
- struct list *oneList = (struct list *)l;
+ struct list **oneList = (struct list **)l;
/* Append a suffix to be able to differentiate tags and fields at reading
time */
@@ -88,19 +88,20 @@ void unpack_values(void *l, json_object *valuesJ, const char *key)
strcpy(suffixed_key, key);
strcat(suffixed_key, "_f");
- add_elt(&oneList, suffixed_key, valuesJ);
+ add_elt(oneList, suffixed_key, valuesJ);
}
void unpack_metadata(void *l, json_object *valuesJ, const char *key)
{
- struct list *oneList = (struct list *)l;
+ struct list **oneList = (struct list **)l;
/* Append a suffix to be able to differentiate tags and fields at reading
time */
char *suffixed_key = calloc(1, strlen(key) +3);
+ strcat(suffixed_key, key);
strcat(suffixed_key, "_t");
- add_elt(&oneList, suffixed_key, valuesJ);
+ add_elt(oneList, suffixed_key, valuesJ);
}
void unpacking_from_api(void *s, json_object *valueJ, const char *key)
@@ -114,9 +115,9 @@ void unpacking_from_api(void *s, json_object *valueJ, const char *key)
else if(strcasecmp("timestamp", key) == 0)
serie->timestamp = get_ts();
else if(strcasecmp("metadata", key) == 0)
- wrap_json_object_for_all(valueJ, unpack_metadata, (void*)serie->serie_columns.tags);
+ wrap_json_object_for_all(valueJ, unpack_metadata, (void*)&serie->serie_columns.tags);
else if(strcasecmp("value", key) == 0 || strcasecmp("values", key) == 0)
- wrap_json_object_for_all(valueJ, unpack_values, (void*)serie->serie_columns.fields);
+ wrap_json_object_for_all(valueJ, unpack_values, (void*)&serie->serie_columns.fields);
/* Treat all key looking for tag and field object. Those ones could be find
with the last 2 character. '_t' for tag and '_f' that are the keys that
could be indefinite. Cf influxdb documentation: