beats: github.com/elastic/beats/filebeat/harvester Index | Files

package harvester

import "github.com/elastic/beats/filebeat/harvester"

Index

Package Files

forwarder.go harvester.go registry.go source.go util.go

Constants

const (
    LogType       = "log"
    StdinType     = "stdin"
    RedisType     = "redis"
    UdpType       = "udp"
    DockerType    = "docker"
    ContainerType = "container"
)

Contains available input types

func MatchAny Uses

func MatchAny(matchers []match.Matcher, text string) bool

MatchAny checks if the text matches any of the regular expressions

type Forwarder Uses

type Forwarder struct {
    Outlet Outlet
}

Forwarder contains shared options between all harvesters needed to forward events

func NewForwarder Uses

func NewForwarder(outlet Outlet) *Forwarder

NewForwarder creates a new forwarder instances and initialises processors if configured

func (*Forwarder) Send Uses

func (f *Forwarder) Send(event beat.Event) error

Send updates the input state and sends the event to the spooler All state updates done by the input itself are synchronous to make sure no states are overwritten

type ForwarderConfig Uses

type ForwarderConfig struct {
    Type string `config:"type"`
}

ForwarderConfig contains all config options shared by all harvesters

type Harvester Uses

type Harvester interface {
    ID() uuid.UUID
    Run() error
    Stop()
}

Harvester contains all methods which must be supported by each harvester so the registry can be used by the input

type Outlet Uses

type Outlet interface {
    OnEvent(data beat.Event) bool
}

Outlet interface is used for forwarding events

type Registry Uses

type Registry struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

Registry struct manages (start / stop) a list of harvesters

func NewRegistry Uses

func NewRegistry() *Registry

NewRegistry creates a new registry object

func (*Registry) Len Uses

func (r *Registry) Len() uint64

Len returns the current number of harvesters in the registry

func (*Registry) Start Uses

func (r *Registry) Start(h Harvester) error

Start starts the given harvester and add its to the registry

func (*Registry) Stop Uses

func (r *Registry) Stop()

Stop stops all harvesters in the registry

func (*Registry) WaitForCompletion Uses

func (r *Registry) WaitForCompletion()

WaitForCompletion can be used to wait until all harvesters are stopped

type Source Uses

type Source interface {
    io.ReadCloser
    Name() string
    Removed() bool // check if source has been removed
    Stat() (os.FileInfo, error)
    Continuable() bool // can we continue processing after EOF?
    HasState() bool    // does this source have a state?
}

Package harvester imports 8 packages (graph) and is imported by 104 packages. Updated 2019-08-15. Refresh now. Tools for package owners.