Can we set the client id as a variable in filebeat.yml file? Here we are using filebeat 6.x
Here is the sample config file below:
#----------------------------- Kafka output --------------------------------
output.kafka:
# initial brokers for reading cluster metadata
hosts: ["mybroker1:9092","mybroker2:9092","mybroker3:9092","mybroker4:9092","mybroker5:9092","mybroker6:9092","mybroker7:9092","mybroker8:9092","mybroker9:9092"]
# message topic selection + partitioning
topic: '%{[topic]}'
client_id: '%{[ClientID]}'
- type: log
paths:
- /var/log/filebeat/*
- /var/log/metricbeat/*
json.message_key:
json.add_error_key: true
json.keys_under_root: true
tail_files: true
fields_under_root: true
fields:
service: abc
topic: mytopic
ClientID: myclientid
Error shown : "message":"Invalid kafka configuration: kafka: invalid configuration (ClientID is invalid)"}