filter

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 29 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConvertUnknownFormat error = errors.New("unknown format")
View Source
var MustStringTypeError = errors.New("timestamp field must be string")

Functions

func BuildFilter

func BuildFilter(filterType string, config map[interface{}]interface{}) topology.Filter

BuildFilter builds Filter from filter type and config. it firstly tries built-in filter, and then try 3rd party plugin

func Register

func Register(filterType string, bf BuildFilterFunc)

Register is used by input plugins to register themselves

Types

type AddFilter

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

func (*AddFilter) Filter

func (plugin *AddFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

type ArrayFloatConverter

type ArrayFloatConverter struct{}

type ArrayIntConverter

type ArrayIntConverter struct{}

type BoolConverter

type BoolConverter struct{}

type BuildFilterFunc

type BuildFilterFunc func(map[interface{}]interface{}) topology.Filter

type ConvertFilter

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

func (*ConvertFilter) Filter

func (plugin *ConvertFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

type Converter

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

type ConveterAndRender

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

type DateFilter

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

func (*DateFilter) Filter

func (plugin *DateFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

type DateParser

type DateParser interface {
	Parse(interface{}) (time.Time, error)
}

type FiltersFilter

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

func (*FiltersFilter) Filter

func (f *FiltersFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

func (*FiltersFilter) SetBelongTo

func (f *FiltersFilter) SetBelongTo(next topology.Processor)

type FloatConverter

type FloatConverter struct{}

type FormatParser

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

func (*FormatParser) Parse

func (dp *FormatParser) Parse(t interface{}) (time.Time, error)

type Grok

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

func NewGrok

func NewGrok(match string, patternPaths []string, ignoreBlank bool) *Grok

type GrokFilter

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

func (*GrokFilter) Filter

func (gf *GrokFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

type GsubFilter added in v1.8.2

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

GsubFilter implements topology.Filter.

func (*GsubFilter) Filter added in v1.8.2

func (f *GsubFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

Filter implements topology.Filter. One field config fails if could not get src or src is not string. Filter returns false if either field config fails.

type IPIPFilter

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

func (*IPIPFilter) Filter

func (plugin *IPIPFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

type IntConverter

type IntConverter struct{}

type JSONFilter added in v1.9.13

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

JSONFilter will parse json string in `field` and put the result into `target` field

func (*JSONFilter) Filter added in v1.9.13

func (plugin *JSONFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

Filter will parse json string in `field` and put the result into `target` field

type KVFilter

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

func (*KVFilter) Filter

func (p *KVFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

type LinkMetricFilter

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

func (*LinkMetricFilter) Filter

func (f *LinkMetricFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

func (*LinkMetricFilter) SetBelongTo

func (f *LinkMetricFilter) SetBelongTo(next topology.Processor)

type LinkStatsMetricFilter

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

func (*LinkStatsMetricFilter) Filter

func (f *LinkStatsMetricFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

func (*LinkStatsMetricFilter) SetBelongTo

func (f *LinkStatsMetricFilter) SetBelongTo(next topology.Processor)

type LowercaseFilter

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

func (*LowercaseFilter) Filter

func (plugin *LowercaseFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

如果字段不是字符串, 返回false, 其它返回true

type RemoveFilter

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

func (*RemoveFilter) Filter

func (plugin *RemoveFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

type RenameFilter

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

func (*RenameFilter) Filter

func (plugin *RenameFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

type ReplaceFilter

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

func (*ReplaceFilter) Filter

func (p *ReplaceFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

如果字段不是字符串, 返回false, 其它返回true

type SplitFilter

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

func (*SplitFilter) Filter

func (plugin *SplitFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

type StringConverter

type StringConverter struct{}

type TranslateFilter

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

func (*TranslateFilter) Filter

func (plugin *TranslateFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

type UIntConverter added in v1.7.14

type UIntConverter struct{}

type URLDecodeFilter

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

func (*URLDecodeFilter) Filter

func (plugin *URLDecodeFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

如果字段不是字符串, 返回false, 其它返回true

type UnixMSParser

type UnixMSParser struct{}

func (*UnixMSParser) Parse

func (p *UnixMSParser) Parse(t interface{}) (time.Time, error)

type UnixParser

type UnixParser struct{}

func (*UnixParser) Parse

func (p *UnixParser) Parse(t interface{}) (time.Time, error)

type UppercaseFilter

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

func (*UppercaseFilter) Filter

func (plugin *UppercaseFilter) Filter(event map[string]interface{}) (map[string]interface{}, bool)

如果字段不是字符串, 返回false, 其它返回true

Jump to

Keyboard shortcuts

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