input: chunk: fix tag lookup handling
@@ -269,12 +269,18 @@ int flb_input_chunk_append_raw(struct flb_input_instance *in,
/*
* Some callers might not set a custom tag, on that case just inherit
- * the instance name.
+ * the fixed instance tag or instance name.
*/
if (!tag) {
+ if (in->tag && in->tag_len > 0) {
+ tag = in->tag;
+ tag_len = in->tag_len;
+ }
+ else {
tag = in->name;
tag_len = strlen(in->name);
}
+ }
/*
* Get a target input chunk, can be one with remaining space available
