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]]
|
|
|
|
### urls of NATS servers
|
|
|
|
servers = ["nats://localhost:4222"]
|
|
|
|
### Use Transport Layer Security
|
|
|
|
secure = false
|
|
|
|
### subject(s) to consume
|
|
|
|
subjects = ["telegraf"]
|
|
|
|
### name a queue group
|
|
|
|
queue_group = "telegraf_consumers"
|
2016-02-12 10:05:33 +00:00
|
|
|
### Maximum number of metrics to buffer between collection intervals
|
|
|
|
metric_buffer = 100000
|
2016-02-09 22:03:46 +00:00
|
|
|
|
2016-02-10 23:28:52 +00:00
|
|
|
### Data format to consume. This can be "json", "influx" or "graphite"
|
|
|
|
### Each data format has it's own unique set of configuration options, read
|
|
|
|
### more about them here:
|
2016-02-18 20:37:36 +00:00
|
|
|
### https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
|
2016-02-10 23:28:52 +00:00
|
|
|
data_format = "influx"
|
|
|
|
```
|