/sensu-severity-filter

Filter Sensu Go Events by severity (ok, warning, critical, unknown)

Primary LanguageJavaScriptMIT LicenseMIT

Sensu Go Severity Filter

TravisCI: TravisCI Build Status

The Sensu Go Severity Filter is a Sensu Event Filter that filters Sensu Go Events by Check status severity (ok, warning, critical, unknown).

This Filter Asset implements the Sensu 1.x built-in Handler severities filter logic.

The severities filter logic excludes events unless their check exit status matches the specified severity, except for certain OK-severity events.

OK-severity events are allowed when the available check history includes a match for the severity specified in the filter.

Usage

Installation

Assets are the best way to make use of this plugin. If you're using sensuctl 5.13 or later, you can use the following command to add the asset:

sensuctl asset add portertech/sensu-severity-filter --rename severity-filter

Configuration

Define one or more filters with sensu-severity-filter as a runtime asset and using the has_severity function in a filter expression. The following example shows a filter which will allow events with a critical check severity:

---
type: EventFilter
api_version: core/v2
metadata:
  name: only_critical
  namespace: default
spec:
  action: allow
  runtime_assets:
    - severity-filter
  expressions:
    - has_severity(event, "critical")