Skip to content

Commit

Permalink
Add sample for exec plugin. Fixes influxdata#245
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Dementiev committed Oct 13, 2015
1 parent 0bc76f0 commit df7f212
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions plugins/exec/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Exec Plugin

The exec plugin can execute arbitrary commands which return flattened
JSON.
The exec plugin can execute arbitrary commands which output JSON. Then it flattens JSON and finds all float values.

For example, if you have a json-returning command called mycollector, you could
setup the exec plugin with:
Expand All @@ -18,3 +17,23 @@ The name is used as a prefix for the measurements.
The interval is used to determine how often a particular command should be run. Each
time the exec plugin runs, it will only run a particular command if it has been at least
`interval` seconds since the exec plugin last ran the command.


# Sample

Let's say that we have a command which gives the following output:
```json
{
"a": 0.5,
"b": {
"c": "some text",
"d": 0.1
}
}
```

The collected metrics will be:
```
exec_catter_a value=0.5
exec_catter_b_d value=0.1
```

0 comments on commit df7f212

Please sign in to comment.