out_loki: validate labels_keys list is set or not at init
@@ -301,6 +301,7 @@ static int parse_labels(struct flb_loki *ctx)
}
/* Append label keys set in the configuration */
+ if (ctx->label_keys) {
mk_list_foreach(head, ctx->label_keys) {
entry = mk_list_entry(head, struct flb_slist_entry, _head);
if (entry->str[0] != '$') {
@@ -317,6 +318,7 @@ static int parse_labels(struct flb_loki *ctx)
ra_used++;
}
}
+ }
/* If there is no record accessor keys, we can just cache a fixed string */
if (ra_used == 0) {
