glob

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

Glob Filter Plugin

The glob filter accepts event when it's routing key, labels and fields mathes configured globs.

All labels must exist and match any glob, all fields must exist, be a string and match any glob, finally, event routing key must match any glob, otherwise the event will be rejected.
If label or field not mentioned in configuration, if routing_key is empty, it's not checking.

Glob syntax is similar to standard wildcards.

Configuration

[[processors]]
  [processors.through]
  [processors.through.filters.glob]
    # list of patterns, one of which an event routing key must match
    routing_key = [ "http*" ]

    # "labels" is a "label name -> patterns list" map
    [processors.through.filters.glob.labels]
      # list of patterns, one of which an event label must match
      # if label does not exists or not matched any pattern
      # event will be rejected
      sender = [ "*:8765" ]

    # "fields" is a "field path -> patterns list" map
    [processors.through.filters.glob.fields]
      # list of patterns, one of which an event field must match
      # if field does not exists, not a string or not matched any pattern
      # event will be rejected
      message = [ "*docker*", "*podman*" ]
      # use dots as a path separator to access nested keys
      "log.file" = [ "*daemon.json" ]

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Glob

type Glob struct {
	*core.BaseFilter `mapstructure:"-"`
	RK               []string            `mapstructure:"routing_key"`
	Fields           map[string][]string `mapstructure:"fields"`
	Labels           map[string][]string `mapstructure:"labels"`
	// contains filtered or unexported fields
}

func (*Glob) Close

func (f *Glob) Close() error

func (*Glob) Init

func (f *Glob) Init() error

func (*Glob) Run

func (f *Glob) Run()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL