telegraf/plugins/inputs/EXAMPLE_README.md

78 lines
2.1 KiB
Markdown
Raw Normal View History

# Example Input Plugin
2020-01-23 23:33:13 +00:00
The `example` plugin gathers metrics about example things. This description
2017-04-21 21:25:37 +00:00
explains at a high level what the plugin does and provides links to where
additional information can be found.
Telegraf minimum version: Telegraf x.x
Plugin minimum tested version: x.x
### Configuration
2017-09-14 22:50:55 +00:00
This section contains the default TOML to configure the plugin. You can
generate it using `telegraf --usage <plugin-name>`.
2016-02-09 22:03:46 +00:00
```toml
[[inputs.example]]
2017-09-14 22:50:55 +00:00
example_option = "example_value"
```
#### example_option
A more in depth description of an option can be provided here, but only do so
if the option cannot be fully described in the sample config.
### Metrics
2017-04-21 21:25:37 +00:00
Here you should add an optional description and links to where the user can
get more information about the measurements.
2017-09-14 22:50:55 +00:00
If the output is determined dynamically based on the input source, or there
are more metrics than can reasonably be listed, describe how the input is
mapped to the output.
- measurement1
2017-09-14 22:50:55 +00:00
- tags:
- tag1 (optional description)
- tag2
- fields:
- field1 (type, unit)
- field2 (float, percent)
+ measurement2
2017-09-14 22:50:55 +00:00
- tags:
- tag3
2017-09-14 22:50:55 +00:00
- fields:
- field3 (integer, bytes)
2020-01-23 23:33:13 +00:00
- field4 (integer, green=1 yellow=2 red=3)
- field5 (string)
- field6 (float)
- field7 (boolean)
### Sample Queries
2016-08-08 22:06:03 +00:00
This section can contain some useful InfluxDB queries that can be used to get
started with the plugin or to generate dashboards. For each query listed,
2017-04-21 21:25:37 +00:00
describe at a high level what data is returned.
2016-08-08 22:06:03 +00:00
2017-04-21 21:25:37 +00:00
Get the max, mean, and min for the measurement in the last hour:
2016-08-08 22:06:03 +00:00
```
SELECT max(field1), mean(field1), min(field1) FROM measurement1 WHERE tag1=bar AND time > now() - 1h GROUP BY tag
```
### Troubleshooting
This optional section can provide basic troubleshooting steps that a user can
perform.
### Example Output
2017-09-14 22:50:55 +00:00
This section shows example output in Line Protocol format. You can often use
`telegraf --input-filter <plugin-name> --test` or use the `file` output to get
this information.
```
measurement1,tag1=foo,tag2=bar field1=1i,field2=2.1 1453831884664956455
measurement2,tag1=foo,tag2=bar,tag3=baz field3=1i 1453831884664956455
```