diff options
author | Matthias Beyer <matthias.beyer@ifm.com> | 2022-04-08 20:32:55 +0200 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@ifm.com> | 2022-04-13 14:57:53 +0200 |
commit | e0b49f03d6f9c21adc1150f2dfb90c40e68884ce (patch) | |
tree | c8162be9a104596117c6b770e25696f227ebb139 /plugins/plugin_measurement_filter/README.md | |
parent | e9ed5848bd095942a4c6e1968edd9a584f6d872a (diff) |
Add plugin_measurement_filter
This patch initially adds a "measurement_filter" plugin, which can be
used to extract values from measurement messages and apply a filter
function on them.
If the filter matches, the plugin forwards the message to a certain
other plugin, if not it can optionally send the message to an
alternative plugin.
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
Diffstat (limited to 'plugins/plugin_measurement_filter/README.md')
-rw-r--r-- | plugins/plugin_measurement_filter/README.md | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/plugins/plugin_measurement_filter/README.md b/plugins/plugin_measurement_filter/README.md new file mode 100644 index 00000000..d695150b --- /dev/null +++ b/plugins/plugin_measurement_filter/README.md @@ -0,0 +1,55 @@ +# plugin_measurement_filter + +The "measurement_filter" plugin can be used to extract values from measurement +messages and apply a filter function on them. If the filter matches, the plugin +forwards the message to a certain plugin, if not it can optionally send the +message to an alternative plugin. + + +## Configuration + +The plugin configuration is made out of four values: + +* The target plugin to send messages to that are filtered +* An optional alternative plugin that messages get send to that are "filtered + out" +* An extractor, that must be used to extract a value from a measurement message + for filtering +* A filter predicate + +An example would look like this: + +```toml +target = "logger" +filtered_target = "some_other_plugin" # optional + +# Extract the value from messages named "temperature" at field "fahrenheit" +extractor = "temperature.fahrenheit" + +# Messages with fahrenheit > 70 are send to "target", all others to +# "filtered_target" or dropped +more_than = 70.0 +``` + + +## Available filter predicates + +```toml +# Boolean +is = true + +# Float +less_than = 10.0 +more_than = 10.0 + +# String +contains = "foo" +excludes = "foo" +``` + +One of them must be used, using multiple is not supported. + +If a filter does not match the expected type (e.g. the value to filter is a +boolean, but you try to filter with `more_than = 10.0`) the filter +implementation will return false. + |