filters

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: GPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

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

Base is inherited from the feeders

func (*Base) GetIdentifier

func (f *Base) GetIdentifier() string

GetIdentifier returns the Node identifier ID used in the bus

func (*Base) Log added in v0.8.2

func (f *Base) Log(format string, args ...interface{})

Log print a debug line prepending the name of the rule and of the filter

func (*Base) Name

func (f *Base) Name() string

Name returns the Filter's name

func (*Base) Pipe

func (f *Base) Pipe(msg *data.Message)

Pipe gets a Message from the previous Node and Propagate it to the next one if the Filter's callback will return true

func (*Base) Propagate

func (f *Base) Propagate(data *data.Message)

Propagate sends the Message to the connected Filters

func (*Base) Rule

func (f *Base) Rule() string

Rule returns the rule in which the Filter is found

type Cache

type Cache struct {
	sync.Mutex
	Base
	// contains filtered or unexported fields
}

Cache handles a cache usable in the rule

func (*Cache) DoFilter

func (f *Cache) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Cache) OnEvent added in v1.3.1

func (f *Cache) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Changed

type Changed struct {
	sync.Mutex
	Base
	// contains filtered or unexported fields
}

Changed is a Filter that call the propagation method only if the input Message is different from the previous one

func (*Changed) DoFilter

func (f *Changed) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Changed) OnEvent added in v1.3.1

func (f *Changed) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Echo

type Echo struct {
	Base
	// contains filtered or unexported fields
}

Echo is a filter that print the input Message on the logs.

func (*Echo) DoFilter

func (f *Echo) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Echo) OnEvent added in v1.3.1

func (f *Echo) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type ElasticSearch added in v1.8.2

type ElasticSearch struct {
	Base
	// contains filtered or unexported fields
}

ElasticSearch is a filter that imports JSON documents in an Elastsic Search database.

func (*ElasticSearch) DoFilter added in v1.8.2

func (f *ElasticSearch) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*ElasticSearch) OnEvent added in v1.8.2

func (f *ElasticSearch) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type File added in v1.8.2

type File struct {
	Base
	// contains filtered or unexported fields
}

File is a filter that interprets the input Message as a file path, reads it and prints it.

func (*File) DoFilter added in v1.8.2

func (f *File) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*File) OnEvent added in v1.8.2

func (f *File) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Filter

type Filter interface {
	Rule() string
	Name() string
	DoFilter(msg *data.Message) (bool, error)
	Pipe(msg *data.Message)
	GetIdentifier() string
	Log(format string, args ...interface{})
	OnEvent(e *data.Event)
	// contains filtered or unexported methods
}

Filter defines Base methods of the object

func NewCacheFilter

func NewCacheFilter(p map[string]string) (Filter, error)

NewCacheFilter is the registered method to instantiate a CacheFilter

func NewChangedFilter

func NewChangedFilter(p map[string]string) (Filter, error)

NewChangedFilter is the registered method to instantiate a ChangedFilter

func NewEchoFilter

func NewEchoFilter(p map[string]string) (Filter, error)

NewEchoFilter is the registered method to instantiate a EchoFilter

func NewElasticSearchFilter added in v1.8.2

func NewElasticSearchFilter(p map[string]string) (Filter, error)

NewElasticSearchFilter is the registered method to instantiate a ElasticSearchFilter

func NewFileFilter added in v1.8.2

func NewFileFilter(params map[string]string) (Filter, error)

NewFileFilter is the registered method to instantiate a File filter

func NewFilter

func NewFilter(rule string, name string, conf map[string]string, bus EventBus.Bus, id int32, neg bool) (Filter, error)

NewFilter creates a new registered Filter from it's name

func NewFormatFilter

func NewFormatFilter(p map[string]string) (Filter, error)

NewFormatFilter is the registered method to instantiate a FormatFilter

func NewHTMLFilter added in v1.14.0

func NewHTMLFilter(p map[string]string) (Filter, error)

NewHTMLFilter is the registered method to instantiate a HtmlFilter

func NewHTTPFilter

func NewHTTPFilter(p map[string]string) (Filter, error)

NewHTTPFilter is the registered method to instantiate a HttpFilter

func NewHashFilter

func NewHashFilter(p map[string]string) (Filter, error)

NewHashFilter is the registered method to instantiate a HashFilter

func NewJsFilter

func NewJsFilter(p map[string]string) (Filter, error)

NewJsFilter is the registered method to instantiate a JsFilter

func NewMailFilter

func NewMailFilter(p map[string]string) (Filter, error)

NewMailFilter is the registered method to instantiate a MailFilter

func NewMimetypeFilter added in v0.8.1

func NewMimetypeFilter(p map[string]string) (Filter, error)

NewMimetypeFilter is the registered method to instantiate a MimetypeFilter

func NewOverrideFilter

func NewOverrideFilter(p map[string]string) (Filter, error)

NewOverrideFilter is the registered method to instantiate a OverrideFilter

func NewPDFFilter added in v0.8.1

func NewPDFFilter(p map[string]string) (Filter, error)

NewPDFFilter is the registered method to instantiate a TextFilter

func NewRandomFilter added in v0.8.2

func NewRandomFilter(p map[string]string) (Filter, error)

NewRandomFilter is the registered method to instantiate a RandomFilter

func NewSlackFilter added in v0.9.1

func NewSlackFilter(p map[string]string) (Filter, error)

NewSlackFilter is the registered method to instantiate a MailFilter

func NewStripTagFilter added in v1.4.0

func NewStripTagFilter(p map[string]string) (Filter, error)

NewStripTagFilter is the registered method to instantiate a StripTagFilter

func NewSystemFilter

func NewSystemFilter(p map[string]string) (Filter, error)

NewSystemFilter is the registered method to instantiate a SystemFilter

func NewTextFilter

func NewTextFilter(p map[string]string) (Filter, error)

NewTextFilter is the registered method to instantiate a TextFilter

func NewURLFilter

func NewURLFilter(p map[string]string) (Filter, error)

NewURLFilter is the registered method to instantiate a UrlFilter

type FilterFactory

type FilterFactory func(conf map[string]string) (Filter, error)

FilterFactory identifies a function to instantiate a Filter using the Factory

type Format

type Format struct {
	Base
	// contains filtered or unexported fields
}

Format is a Filter that apply a Golang Template to the input Message and propagate it to the next Filter

func (*Format) DoFilter

func (f *Format) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Format) OnEvent added in v1.3.1

func (f *Format) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type HTML added in v1.14.0

type HTML struct {
	Base
	// contains filtered or unexported fields
}

HTML is a filter to parse the HTML format

func (*HTML) DoFilter added in v1.14.0

func (f *HTML) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*HTML) OnEvent added in v1.14.0

func (f *HTML) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type HTTP

type HTTP struct {
	Base
	// contains filtered or unexported fields
}

HTTP is a filter to handle http requests using the input Message

func (*HTTP) DoFilter

func (f *HTTP) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*HTTP) OnEvent added in v1.3.1

func (f *HTTP) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Hash

type Hash struct {
	Base
	// contains filtered or unexported fields
}

Hash is a Filter that searches for hashes in the Message

func (*Hash) DoFilter

func (f *Hash) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Hash) OnEvent added in v1.3.1

func (f *Hash) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Js

type Js struct {
	Base
	// contains filtered or unexported fields
}

Js is a Filter that load a plugin written in Javascript to create a custom Filter

func (*Js) DoFilter

func (f *Js) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Js) OnEvent added in v1.3.1

func (f *Js) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Mail

type Mail struct {
	Base
	// contains filtered or unexported fields
}

Mail is a Filter to send e-mail using the input Message

func (*Mail) DoFilter

func (f *Mail) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Mail) OnEvent added in v1.3.1

func (f *Mail) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Mimetype added in v0.8.1

type Mimetype struct {
	Base
	// contains filtered or unexported fields
}

Mimetype is a Filter to detect the format of an input

func (*Mimetype) DoFilter added in v0.8.1

func (f *Mimetype) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Mimetype) OnEvent added in v1.3.1

func (f *Mimetype) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Override

type Override struct {
	Base
	// contains filtered or unexported fields
}

Override is a Filter that allow to change the current Message before to send it to the next Filter

func (*Override) DoFilter

func (f *Override) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Override) OnEvent added in v1.3.1

func (f *Override) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type PDF added in v0.8.1

type PDF struct {
	Base
	// contains filtered or unexported fields
}

PDF is a Filter that extract plain text from a PDF file

func (*PDF) DoFilter added in v0.8.1

func (f *PDF) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*PDF) OnEvent added in v1.3.1

func (f *PDF) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Random added in v0.8.2

type Random struct {
	Base
	// contains filtered or unexported fields
}

Random is a Filter to create a random number

func (*Random) DoFilter added in v0.8.2

func (f *Random) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Random) OnEvent added in v1.3.1

func (f *Random) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Slack added in v0.9.1

type Slack struct {
	Base
	// contains filtered or unexported fields
}

Slack is a Filter to send message, file to a slack channel

func (*Slack) DoFilter added in v0.9.1

func (f *Slack) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Slack) OnEvent added in v1.3.1

func (f *Slack) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type StripTag added in v1.4.0

type StripTag struct {
	Base
	// contains filtered or unexported fields
}

StripTag is a filter that removes HTML tags from a text.

func (*StripTag) DoFilter added in v1.4.0

func (f *StripTag) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*StripTag) OnEvent added in v1.4.0

func (f *StripTag) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type System

type System struct {
	Base
	// contains filtered or unexported fields
}

System is a Filter to exec a command on the host machine using the input Message

func (*System) DoFilter

func (f *System) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*System) OnEvent added in v1.3.1

func (f *System) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type Text

type Text struct {
	Base
	// contains filtered or unexported fields
}

Text is a Filter to search and extract strings from the input Message

func (*Text) DoFilter

func (f *Text) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*Text) OnEvent added in v1.3.1

func (f *Text) OnEvent(event *data.Event)

OnEvent is called when an event occurs

type URL

type URL struct {
	Base
	// contains filtered or unexported fields
}

URL is a Filter to search urls in the input Message

func (*URL) DoFilter

func (f *URL) DoFilter(msg *data.Message) (bool, error)

DoFilter is the mandatory method used to "filter" the input data.Message

func (*URL) OnEvent added in v1.3.1

func (f *URL) OnEvent(event *data.Event)

OnEvent is called when an event occurs

Jump to

Keyboard shortcuts

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