2016-01-26 00:34:09 +00:00
|
|
|
# Example Input Plugin
|
|
|
|
|
2017-04-21 21:25:37 +00:00
|
|
|
The example plugin gathers metrics about example things. This description
|
|
|
|
explains at a high level what the plugin does and provides links to where
|
|
|
|
additional information can be found.
|
2016-01-26 00:34:09 +00:00
|
|
|
|
|
|
|
### Configuration:
|
|
|
|
|
2016-02-09 22:03:46 +00:00
|
|
|
```toml
|
2016-01-26 00:34:09 +00:00
|
|
|
# Description
|
|
|
|
[[inputs.example]]
|
|
|
|
# SampleConfig
|
|
|
|
```
|
|
|
|
|
|
|
|
### Measurements & Fields:
|
|
|
|
|
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.
|
2016-01-26 00:34:09 +00:00
|
|
|
|
|
|
|
- measurement1
|
|
|
|
- field1 (type, unit)
|
|
|
|
- field2 (float, percent)
|
|
|
|
- measurement2
|
|
|
|
- field3 (integer, bytes)
|
|
|
|
|
|
|
|
### Tags:
|
|
|
|
|
|
|
|
- All measurements have the following tags:
|
|
|
|
- tag1 (optional description)
|
|
|
|
- tag2
|
|
|
|
- measurement2 has the following tags:
|
|
|
|
- tag3
|
2017-04-04 01:34:04 +00:00
|
|
|
|
2016-08-08 22:06:03 +00:00
|
|
|
### Sample Queries:
|
|
|
|
|
2017-04-21 21:25:37 +00:00
|
|
|
This section should contain some useful InfluxDB queries that can be used to
|
|
|
|
get started with the plugin or to generate dashboards. For each query listed,
|
|
|
|
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
|
|
|
|
```
|
2016-01-26 00:34:09 +00:00
|
|
|
|
|
|
|
### Example Output:
|
|
|
|
|
|
|
|
```
|
2017-05-12 22:22:29 +00:00
|
|
|
$ telegraf --input-filter example --test
|
2016-01-26 00:34:09 +00:00
|
|
|
measurement1,tag1=foo,tag2=bar field1=1i,field2=2.1 1453831884664956455
|
|
|
|
measurement2,tag1=foo,tag2=bar,tag3=baz field3=1i 1453831884664956455
|
|
|
|
```
|