Attribute filters in a GeoEvent Service filter events based on attribute criteria. An attribute filter can be configured with one or more attribute expressions. The logical combination of these expressions represents the criteria a GeoEvent must satisfy to pass through the filter.
The following attribute operators are supported:
- Equals (=) — This operator retains GeoEvents whose attribute values equal a specified value. For example, IdString = 3XAB891
- Not Equal (!=) — This operator retains GeoEvents whose attribute values do not equal a specified value. For example, StatusString != Err.
Nota:
The Equals (=) and Not Equal (!=) operators should not be applied to floating point values. For example, do not configure a filter expression like Radius = 3.14159, instead use the Greater Than (>), Less Than (<), or other operator.
- Greater Than (>) — This operator retains GeoEvents whose attribute values are greater than a specified value. For example, Speed > 50.
- Greater Or Equal (>=) — This operator retains GeoEvents whose attribute values are greater than or equal to a specified value. For example, Speed >= 50.
- Less Than (<) — This operator retains GeoEvents whose attribute values are less than a specified value. For example, Altitude < 1000.
- Less Or Equal (<=) — This operator retains GeoEvents whose attribute values are less than or equal to a specified value. For example, Altitude <= 1000.
Nota:
The Greater Than (>), Less Than (<), and other operators should not be applied to string values. For example, do not configure a filter expression like Company > ABC, instead use the Equals (=) or Not Equal (!=) operator and incorporate the entire string into the expression.
- IN — This operator retains GeoEvents when a specified field's value exists in a comma-separated list of values. For example, StatusCode IN HK1,HK3,HK5.
- MATCHES — This operator retains GeoEvents when a specified field's value matches a regular expression. For example, StatusCode MATCHES ^HK[135].
Nota:
The specified regular expression is evaluated as either matching or not matching the entire event field value; partial matches are not supported. In the example above, if the StatusCode contained additional characters beyond the single numeric digit, the expression would need to include .* to match any trailing characters in the attribute value.
- EXISTS — This operator retains GeoEvents when a specified field exists in the received event's schema. For example, Geometry EXISTS.
- ISNULL — This operator retains GeoEvents when a specified field contains a null value. For example, Geometry ISNULL.
Nota:
String attribute values may be null or empty. A string whose length is zero is defined as an empty string. A string object whose value is undefined is a null string. Use the ISNULL operator to test if a string is null. Use the MATCHES operator with the regular expression ^$ to test if a string is a zero-length (or empty) string.