filters

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FilterPluginNames = []string{
	"nop",
	"sample",
}

Functions

func FiltersRun

func FiltersRun(config common.MapStr, plugins map[Filter]FilterPlugin,
	next chan common.MapStr, stopCb func()) (input chan common.MapStr, err error)

Types

type Filter

type Filter int
const (
	NopFilter Filter = iota
	SampleFilter
)

func FilterFromName

func FilterFromName(name string) (Filter, error)

func (Filter) String

func (filter Filter) String() string

type FilterPlugin

type FilterPlugin interface {

	// New creates a new FilterPlugin instance with the
	// given name and configuration.
	New(name string, config map[string]interface{}) (FilterPlugin, error)

	// Filter executes the filter.
	Filter(event common.MapStr) (common.MapStr, error)

	// String returns the name of the filter.
	String() string

	// Type returns the type of the filter.
	Type() Filter
}

The FilterPlugin interface needs to be implemented by all the filtering plugins.

func LoadConfiguredFilters

func LoadConfiguredFilters(config map[string]interface{}) ([]FilterPlugin, error)

LoadConfiguredFilters interprets the filters configuration, loads the configured plugins and returns the order in which they need to be executed.

type FilterRunner

type FilterRunner struct {
	FiltersQueue chan common.MapStr
	// contains filtered or unexported fields
}

Executes the filters

func NewFilterRunner

func NewFilterRunner(results chan common.MapStr, order []FilterPlugin) *FilterRunner

Create a new FilterRunner

func (*FilterRunner) Run

func (runner *FilterRunner) Run() error

Goroutine that reads the objects from the FiltersQueue, executes all filters on them and writes the modified objects in the results channel.

type FiltersList

type FiltersList struct {
	// contains filtered or unexported fields
}

Contains a list of the available filter plugins.

var Filters FiltersList

func (FiltersList) Get

func (filters FiltersList) Get(filter Filter) FilterPlugin

func (FiltersList) Register

func (filters FiltersList) Register(filter Filter, plugin FilterPlugin)

Directories

Path Synopsis
Package nop implements a Packetbeat filter that does absolutely nothing.
Package nop implements a Packetbeat filter that does absolutely nothing.

Jump to

Keyboard shortcuts

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