filter

package
v0.0.0-...-38f40ef Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2017 License: MPL-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package filter contains the interfaces, structs, and logic that form the basis of protonds filter plugin subsystem.

Protond currently implements the following filter plugins:

  • Noop
  • A no operation filter which just returns the event unchanged, this is used for pass through protond relays and testing protond.
  • Javascript
  • This plugin allows for arbitrary javascript scripts that can modify and call certain functions on all events.

Index

Constants

View Source
const (
	// NoopFilter defines a filter that does nothing.
	NoopFilter = "noop"

	// JavascriptFilter defines a javascript based filter.
	JavascriptFilter = "js"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter interface {
	// Run should take in the supplied event and preform the filtering, and then return the filtered event and a nil error object, if there is an error during the process the returned event should be the unchanged supplied event and the error object should contain the error.
	Run(*common.Event) (*common.Event, error)

	// Name returns the name of the filter plugin.
	Name() string
}

Filter is the interface that plugins must adhere to for operation as a filter plugin.

func New

func New(filterPlugin string, config *common.Config, filterConfig *common.FilterConfig, internalCache cache.Cache, alerts map[string]alert.Alert) (Filter, error)

New generates a filter plugin based on the passed in plugin and user defined configuration.

type Javascript

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

Javascript is a struct representing the javascript filter plugin.

func (*Javascript) Name

func (js *Javascript) Name() string

Name returns configured name for the javascript filter.

func (*Javascript) Run

func (js *Javascript) Run(event *common.Event) (ret *common.Event, err error)

Run will return a parsed object based on the configured javascript filter.

type Noop

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

Noop is a struct representing the standard input plugin.

func (*Noop) Name

func (noop *Noop) Name() string

Name returns 'Noop'.

func (*Noop) Run

func (noop *Noop) Run(event *common.Event) (*common.Event, error)

Run will return the event unchanged.

Jump to

Keyboard shortcuts

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