Alarm or collection filter
You can validate the content of an alarm, a collection or any map structured object with one or multiple filters.
A filter compare a content
with the value of the given field
based on an operation
.
- Filter.content
Value to compare with. Type depend on the type of the field or on the chosen operation.
- Filter.operation
Operation to apply. The following operation are currently available:
EQUAL
: values are the sameNOT_EQUAL
: values are differentGREATER_THAN
: value from data greater than filter contentGREATER_THAN_EQUAL
: value from data greater than or equal to filter contentLESS_THAN
: value from data lesser than filter contentLESS_THAN_EQUAL
: value from data lesser than or equal to filter contentSIZE_EQUAL
: (arrays only) values size are the sameSIZE_NOT_EQUAL
: (arrays only) values size are differentSIZE_GREATER_THAN
: (arrays only) value size from data greater than filter content sizeSIZE_GREATER_THAN_EQUAL
: (arrays only) value size from data greater than or equal to filter content sizeSIZE_LESS_THAN
: (arrays only) value size from data lesser than filter content sizeSIZE_LESS_THAN_EQUAL
: (arrays only) value size from data lesser than or equal to filter content sizeCONTAIN
: (array only) value contain filter contentNOT_CONTAIN
: (array only) value doesn’t contain filter contentSTART_WITH
: value starts with filter contentEND_WITH
: value ends with filter contentNEWER_THAN
: (dates only) value (date) is newer than now - filter content (seconds)NEWER_THAN_EQUAL
: (dates only) value (date) is newer or equal than now - filter content (seconds)OLDER_THAN
: (dates only) value (date) is older than now - filter content (seconds)OLDER_THAN_EQUAL
: (dates only) value (date) is older or equal than now - filter content (seconds)ARRAY_BETWEEN
: filter content must be an array of 2. First element used in aGREATER_THAN_EQUAL
filter and second element in aLESS_THAN
filter. Is true if both are trueOR
: Content is an array of filters. If any one of those filters are true, then true.AND
: Content is an array of filters. If every one of those filters are true, then true.
- Filter.field
Name of the field from the data we want to filter (i.e. from an alarm could be severity, source or any other field from an alarm).
- filters.allMatch(data: object, filters: object[])
Check if the provided data match all given filters.
- filters.anyMatch(data: object, filters: object[])
Check if the provided data match any given filters.