outil

package
v5.3.3+incompatible Latest Latest
Warning

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

Go to latest
Published: May 4, 2017 License: Apache-2.0 Imports: 4 Imported by: 826

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Selector

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

func BuildSelectorFromConfig

func BuildSelectorFromConfig(
	cfg *common.Config,
	settings Settings,
) (Selector, error)

func MakeSelector

func MakeSelector(es ...SelectorExpr) Selector

func (Selector) IsConst

func (s Selector) IsConst() bool

func (Selector) IsEmpty

func (s Selector) IsEmpty() bool

func (Selector) Select

func (s Selector) Select(evt common.MapStr) (string, error)

Select runs configured selector against the current event. If no matching selector is found, an empty string is returned. It's up to the caller to decide if an empty string is an error or an expected result.

type SelectorExpr

type SelectorExpr interface {
	// contains filtered or unexported methods
}

func ConcatSelectorExpr

func ConcatSelectorExpr(s ...SelectorExpr) SelectorExpr

func ConditionalSelectorExpr

func ConditionalSelectorExpr(
	s SelectorExpr,
	cond *processors.Condition,
) SelectorExpr

func ConstSelectorExpr

func ConstSelectorExpr(s string) SelectorExpr

func EmptySelectorExpr

func EmptySelectorExpr() SelectorExpr

func FmtSelectorExpr

func FmtSelectorExpr(fmt *fmtstr.EventFormatString, fallback string) SelectorExpr

func LookupSelectorExpr

func LookupSelectorExpr(
	s SelectorExpr,
	table map[string]string,
	fallback string,
) SelectorExpr

type Settings

type Settings struct {
	// single selector key and default option keyword
	Key string

	// multi-selector key in config
	MultiKey string

	// if enabled a selector `key` in config will be generated, if `key` is present
	EnableSingleOnly bool

	// Fail building selector if `key` and `multiKey` are missing
	FailEmpty bool
}

Jump to

Keyboard shortcuts

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