Filter Log Record Attribute

Log Record Attribute Filter Processor

The Log Record Attribute Filter processor can be used to include or exclude logs based on matched attributes.

Supported Types

MetricsLogsTraces

Configuration Table

ParameterTypeDefaultDescription
actionenumexcludeWhether to include (retain) or exclude (drop) matches.
match_typeenumstrictMethod for matching values. Strict matching requires that 'value' be an exact match. Regexp matching uses re2 to match a value.
attributesmaprequiredOne or more key (attribute name) value (attribute value) pairs to filter on. Logs are filtered if all pairs are matched.

Example Configuration

Web Interface

filter_log_record_attribute

Strict Exclude

Exclude logs that have the following attributes:

  • environment: dev
  • location: us-east1-b
apiVersion: bindplane.observiq.com/v1
kind: Processor
metadata:
  id: exclude-attributes
  name: exclude-attributes
spec:
  type: filter_log_record_attribute
  parameters:
    - name: action
      value: exclude
    - name: match_type
      value: strict
    - name: attributes
      value:
        environment: dev
        location: us-east1-b

Strict Include

Include logs that have the following attributes. All other logs will be filtered out:

  • environment: dev
  • location: us-east1-b
apiVersion: bindplane.observiq.com/v1
kind: Processor
metadata:
  id: include-attributes
  name: include-attributes
spec:
  type: filter_log_record_attribute
  parameters:
    - name: action
      value: exclude
    - name: match_type
      value: strict
    - name: attributes
      value:
        environment: dev
        location: us-east1-b

Regexp Exclude

Exclude logs that have the following attribute with any value:

  • env: *
apiVersion: bindplane.observiq.com/v1
kind: Processor
metadata:
  id: exclude-attributes
  name: exclude-attributes
spec:
  type: filter_log_record_attribute
  parameters:
    - name: action
      value: exclude
    - name: match_type
      value: regexp
    - name: attributes
      value:
        env: "*"