2016-02-09 22:03:46 +00:00
|
|
|
# NATS Consumer Input Plugin
|
2016-02-10 23:28:52 +00:00
|
|
|
|
2016-02-09 22:03:46 +00:00
|
|
|
The [NATS](http://www.nats.io/about/) consumer plugin reads from
|
2016-02-10 23:28:52 +00:00
|
|
|
specified NATS subjects and adds messages to InfluxDB. The plugin expects messages
|
2016-02-18 20:37:36 +00:00
|
|
|
in the [Telegraf Input Data Formats](https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md).
|
2016-02-10 23:28:52 +00:00
|
|
|
A [Queue Group](http://www.nats.io/documentation/concepts/nats-queueing/)
|
|
|
|
is used when subscribing to subjects so multiple instances of telegraf can read
|
|
|
|
from a NATS cluster in parallel.
|
|
|
|
|
|
|
|
## Configuration
|
2016-02-09 22:03:46 +00:00
|
|
|
|
|
|
|
```toml
|
2016-02-10 23:28:52 +00:00
|
|
|
# Read metrics from NATS subject(s)
|
|
|
|
[[inputs.nats_consumer]]
|
2016-02-18 21:26:51 +00:00
|
|
|
## urls of NATS servers
|
2016-02-10 23:28:52 +00:00
|
|
|
servers = ["nats://localhost:4222"]
|
2016-02-18 21:26:51 +00:00
|
|
|
## Use Transport Layer Security
|
2016-02-10 23:28:52 +00:00
|
|
|
secure = false
|
2016-02-18 21:26:51 +00:00
|
|
|
## subject(s) to consume
|
2016-02-10 23:28:52 +00:00
|
|
|
subjects = ["telegraf"]
|
2016-02-18 21:26:51 +00:00
|
|
|
## name a queue group
|
2016-02-10 23:28:52 +00:00
|
|
|
queue_group = "telegraf_consumers"
|
2016-02-18 21:26:51 +00:00
|
|
|
## Maximum number of metrics to buffer between collection intervals
|
2016-02-12 10:05:33 +00:00
|
|
|
metric_buffer = 100000
|
2016-02-09 22:03:46 +00:00
|
|
|
|
2016-04-05 20:42:20 +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-10 23:28:52 +00:00
|
|
|
data_format = "influx"
|
|
|
|
```
|