I’m using inputs.kafka_consumer to read data from two topics and would like to use the kafka topic name as a tag to differentiate the data in my single elasticsearch index. I’ve tried this, but I don’t see the tag in my index:
[[inputs.kafka_consumer]]
## Kafka brokers.
brokers = [{{ sa_kafka_brokers }}]
## Topics to consume.
topics = [{{ kafka_topics_ucv }}]
## When set this tag will be added to all metrics with the topic as the value.
topic_tag = ""
It seems you need to put a string inside the “” to name the tag, not the value. I misunderstood the documentation and thought that if you put something inside the “” it would add a static tag.