2016-02-09 22:03:46 +00:00
|
|
|
# Kafka Consumer Input Plugin
|
2015-07-08 19:39:23 +00:00
|
|
|
|
|
|
|
The [Kafka](http://kafka.apache.org/) consumer plugin polls a specified Kafka
|
|
|
|
topic and adds messages to InfluxDB. The plugin assumes messages follow the
|
|
|
|
line protocol. [Consumer Group](http://godoc.org/github.com/wvanbergen/kafka/consumergroup)
|
|
|
|
is used to talk to the Kafka cluster so multiple instances of telegraf can read
|
|
|
|
from the same topic in parallel.
|
|
|
|
|
2017-06-08 01:22:28 +00:00
|
|
|
For old kafka version (< 0.8), please use the kafka_consumer_legacy input plugin
|
|
|
|
and use the old zookeeper connection method.
|
|
|
|
|
2016-02-09 22:03:46 +00:00
|
|
|
## Configuration
|
|
|
|
|
|
|
|
```toml
|
|
|
|
# Read metrics from Kafka topic(s)
|
|
|
|
[[inputs.kafka_consumer]]
|
2016-02-18 21:26:51 +00:00
|
|
|
## topic(s) to consume
|
2016-02-09 22:03:46 +00:00
|
|
|
topics = ["telegraf"]
|
2017-06-08 01:22:28 +00:00
|
|
|
brokers = ["localhost:9092"]
|
2016-02-18 21:26:51 +00:00
|
|
|
## the name of the consumer group
|
2016-02-09 22:03:46 +00:00
|
|
|
consumer_group = "telegraf_metrics_consumers"
|
2016-02-18 21:26:51 +00:00
|
|
|
## Offset (must be either "oldest" or "newest")
|
2016-02-09 22:03:46 +00:00
|
|
|
offset = "oldest"
|
|
|
|
|
2018-05-04 23:33:23 +00:00
|
|
|
## Optional TLS Config
|
|
|
|
# tls_ca = "/etc/telegraf/ca.pem"
|
|
|
|
# tls_cert = "/etc/telegraf/cert.pem"
|
|
|
|
# tls_key = "/etc/telegraf/key.pem"
|
|
|
|
## Use TLS but skip chain & host verification
|
2017-06-08 01:22:28 +00:00
|
|
|
# insecure_skip_verify = false
|
|
|
|
|
|
|
|
## Optional SASL Config
|
|
|
|
# sasl_username = "kafka"
|
|
|
|
# sasl_password = "secret"
|
|
|
|
|
2016-06-22 16:23:53 +00:00
|
|
|
## Data format to consume.
|
2017-04-27 21:59:18 +00:00
|
|
|
## Each data format has its own unique set of configuration options, read
|
2016-02-18 21:26:51 +00:00
|
|
|
## more about them here:
|
|
|
|
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
|
2016-02-09 22:03:46 +00:00
|
|
|
data_format = "influx"
|
2017-04-11 19:05:39 +00:00
|
|
|
|
|
|
|
## Maximum length of a message to consume, in bytes (default 0/unlimited);
|
|
|
|
## larger messages are dropped
|
|
|
|
max_message_len = 65536
|
2016-02-09 22:03:46 +00:00
|
|
|
```
|
|
|
|
|
2015-07-08 19:39:23 +00:00
|
|
|
## Testing
|
|
|
|
|
2016-06-22 16:23:53 +00:00
|
|
|
Running integration tests requires running Zookeeper & Kafka. See Makefile
|
|
|
|
for kafka container command.
|