2022-06-07 07:04:28 +08:00
|
|
|
# Value Parser Plugin
|
2018-09-18 02:45:08 +08:00
|
|
|
|
|
|
|
|
The "value" data format translates single values into Telegraf metrics. This
|
|
|
|
|
is done by assigning a measurement name and setting a single field ("value")
|
|
|
|
|
as the parsed metric.
|
|
|
|
|
|
2021-11-25 02:45:25 +08:00
|
|
|
## Configuration
|
2018-09-18 02:45:08 +08:00
|
|
|
|
|
|
|
|
```toml
|
|
|
|
|
[[inputs.exec]]
|
|
|
|
|
## Commands array
|
|
|
|
|
commands = ["cat /proc/sys/kernel/random/entropy_avail"]
|
|
|
|
|
|
|
|
|
|
## override the default metric name of "exec"
|
|
|
|
|
name_override = "entropy_available"
|
|
|
|
|
|
2022-03-02 00:28:41 +08:00
|
|
|
## override the field name of "value"
|
|
|
|
|
# value_field_name = "value"
|
|
|
|
|
|
2018-09-18 02:45:08 +08:00
|
|
|
## Data format to consume.
|
|
|
|
|
## Each data format has its own unique set of configuration options, read
|
|
|
|
|
## more about them here:
|
|
|
|
|
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
|
|
|
|
|
data_format = "value"
|
|
|
|
|
data_type = "integer" # required
|
|
|
|
|
```
|
2022-06-07 07:04:28 +08:00
|
|
|
|
|
|
|
|
You **must** tell Telegraf what type of metric to collect by using the
|
|
|
|
|
`data_type` configuration option. Available options are:
|
|
|
|
|
|
|
|
|
|
1. integer
|
|
|
|
|
2. float or long
|
|
|
|
|
3. string
|
|
|
|
|
4. boolean
|
|
|
|
|
|
|
|
|
|
**Note:** It is also recommended that you set `name_override` to a measurement
|
|
|
|
|
name that makes sense for your metric, otherwise it will just be set to the
|
|
|
|
|
name of the plugin.
|