From df7f2127f122d095c07e11d5b9f3ce69cc13d769 Mon Sep 17 00:00:00 2001 From: Eugene Dementiev Date: Tue, 13 Oct 2015 20:50:42 +0300 Subject: [PATCH] Add sample for exec plugin. Fixes #245 --- plugins/exec/README.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/plugins/exec/README.md b/plugins/exec/README.md index 456ab2b774cbf..7a55f9c676453 100644 --- a/plugins/exec/README.md +++ b/plugins/exec/README.md @@ -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: @@ -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 +```