Resource Type: sensu_filter

Defined in:
lib/puppet/type/sensu_filter.rb
Providers:
sensuctl
sensu_api

Summary

Manages Sensu filters

Overview

Autorequires:

  • Package[sensu-go-cli]
  • Service[sensu-backend]
  • Sensuctl_configure[puppet]
  • Sensu_api_validator[sensu]
  • Sensu_user[admin]
  • sensu_namespace - Puppet will autorequire sensu_namespace resource defined in namespace property.
  • sensu_asset - Puppet will autorequire sensu_asset resources defined in runtime_assets property.

Examples:

Create a filter

sensu_filter { 'test':
  ensure      => 'present',
  action      => 'allow',
  expressions => ["event.entity.labels.environment == 'production'"],
}

Create a filter with namespace dev in the name

sensu_filter { 'test in dev':
  ensure      => 'present',
  action      => 'allow',
  expressions => ["event.entity.labels.environment == 'production'"],
}

Properties

  • action

    Action to take with the event if the filter expressions match.

    Supported values:
    • allow
    • deny
  • annotations

    Arbitrary, non-identifying metadata to include with event data.

  • ensure (defaults to: present)

    The basic property that the resource should be in.

    Supported values:
    • present
    • absent
  • expressions

    Filter expressions to be compared with event data.

  • labels

    Custom attributes to include with event data, which can be queried like regular attributes.

  • namespace (defaults to: default)

    The Sensu RBAC namespace that this filter belongs to.

  • runtime_assets

    Assets to be applied to the filter's execution context.

    Supported values:
    • /.*/
    • absent

Parameters

  • name (namevar)

    The name of the filter. The name supports composite names that can define the namespace. An example composite name to define resource named test in namespace dev: test in dev

  • provider

    The specific backend to use for this sensu_filter resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

  • resource_name

    The name of the filter.