Filter
The Filter stage filters data from the event. This makes it easy to move parts of the event from the value.
For example, consider data with a SiteId
attribute. SiteId
should be in the MQTT topic but not in the payload. A filter stage can move the SiteId
field from the event value to metadata, and the output can reference metadata to include the SiteId
in the MQTT topic.
The Filter stage works on complex data as well as Arrays of complex data. In the above example, if an array of objects with a SiteId
attribute is passed to the filter, the SiteId
attribute for each array object is filtered.
Attribute List
This list of attributes in the event value to filter. This syntax supports hierarchy in form of parent.child.granchild
. Simple values or complex values can be filtered.
Filter Option
The Attribute List can be either Excluded or Included. When Included, the attributes are included in the value and everything else is removed. When Excluded the attributes in the list are removed and everything else remains.
Retain As Metadata
When enabled, anything removed from the event value is included in the event metadata under the key specified in Metadata Key.
In the above SiteId
example, the MQTT topic output would be {{event.metadata.filter.siteID}}
.
Metadata Key
Specifies the name of the key used to retain the filtered out data in the metadata object.