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 same

  • NOT_EQUAL: values are different

  • GREATER_THAN: value from data greater than filter content

  • GREATER_THAN_EQUAL: value from data greater than or equal to filter content

  • LESS_THAN: value from data lesser than filter content

  • LESS_THAN_EQUAL: value from data lesser than or equal to filter content

  • CONTAIN: (array only) value contain filter content

  • NOT_CONTAIN: (array only) value doesn’t contain filter content

  • START_WITH: value starts with filter content

  • END_WITH: value ends with filter content

  • Array size comparison:

    • SIZE_EQUAL: (arrays only) values size are the same

    • SIZE_NOT_EQUAL: (arrays only) values size are different

    • SIZE_GREATER_THAN: (arrays only) value size from data greater than filter content size

    • SIZE_GREATER_THAN_EQUAL: (arrays only) value size from data greater than or equal to filter content size

    • SIZE_LESS_THAN: (arrays only) value size from data lesser than filter content size

    • SIZE_LESS_THAN_EQUAL: (arrays only) value size from data lesser than or equal to filter content size

  • Relatives date comparison:

    (dates only) filter content as seconds represent the difference between now and the targeted timestamp in the past (i.e content as 5 means 5 seconds in the past).

    • NEWER_THAN: The value (as a date) is newer than the filter content if the value is closer to now than the targeted timestamp. If content is 0, the target timestamp being set as now, nothing could match the filter.

    • NEWER_THAN_EQUAL: The value (as a date) is newer than or equal to the filter content if the value is closer or equal to now than the targeted timestamp. If content is 0, the target timestamp being set as now, only match if strictly equal.

    • OLDER_THAN: The value (as a date) is older than the filter content if the value is further in the past than the targeted timestamp. If content is 0, the target timestamp being set as now, every date set in the past will match.

    • OLDER_THAN_EQUAL: The value (as a date) is older than or equal to the filter content if the value is further in the past or equal than the targeted timestamp. If content is 0, the target timestamp being set as now, every date set in the past or equal will match.

  • ARRAY_BETWEEN: filter content must be an array of 2. First element used in a GREATER_THAN_EQUAL filter and second element in a LESS_THAN filter. Is true if both are true - OR: 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.

Arguments:
  • data – Object to compare filter with.

  • filters – List of object of type Filter().

Returns:

Same as match().

filters.anyMatch(data: object, filters: object[])

Check if the provided data match any given filters.

Arguments:
  • data – Object to compare filter with.

  • filters – List of object of type Filter().

Returns:

Same as match().

filters.match(data: object, filter: object)

Check if the provided data match the given filter.

Arguments:
  • data – Object to compare filter with.

  • filter – Object of type Filter().

Returns:

Boolean that represent the state of the condition.

filters.noneMatch(data: object, filters: object[])

Check if the provided data match none of given filters.

Arguments:
  • data – Object to compare filter with.

  • filters – List of object of type Filter().

Returns:

Same as match().