regex Filter

The foglamp-filter-regex plugin is a simple filter that allows the user to find values in datapoints and replace them with new values. It uses regular expressions to match datapoint values and replaces these values with replacement values.

A set of find and replace expressions are given in an expression map.

When adding filter a configuration page for the filter will be shown as below;

regex_1

The Expressions Map JSON requires expressions as an array of objects, where each object has three attributes,

  • datapoint: Datapoint name, use either “*” or leave blank to apply filter on all the datapoints

  • match: A regular expression to match the value of specified datapoint

  • replace: A new value of datapoint as a replacement, if given regular expression match