Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
type ClientConfig struct { PublishMode PublishMode // EventMetadata configures additional fields/tags to be added to published events. EventMetadata common.EventMetadata // Meta provides additional meta data to be added to the Meta field in the beat.Event // structure. Meta common.MapStr // Fields provides additional 'global' fields to be added to every event Fields common.MapStr // Processors passes additional processor to the client, to be executed before // the pipeline processors. Processor ProcessorList // WaitClose sets the maximum duration to wait on ACK, if client still has events // active non-acknowledged events in the publisher pipeline. // WaitClose is only effective if one of ACKCount, ACKEvents and ACKLastEvents // is configured WaitClose time.Duration // Events configures callbacks for common client callbacks Events ClientEventer // ACKCount reports the number of published events recently acknowledged // by the pipeline. ACKCount func(int) // ACKEvents reports the events recently acknowledged by the pipeline. // Note: The slice passed must be copied if the events are to be processed // after the handler returns. ACKEvents func([]Event) // ACKLastEvent reports the last ACKed event out of a batch of ACKed events only. ACKLastEvent func(Event) }
ClientConfig defines common configuration options one can pass to Pipeline.ConnectWith to control the clients behavior and provide ACK support.
type ClientEventer ¶
type ClientEventer interface { Closing() // Closing indicates the client is being shutdown next Closed() // Closed indicates the client being fully shutdown Published() // event been has successfully forwarded to the publisher pipeline FilteredOut(Event) // event has been filtered out/dropped by processors DroppedOnPublish(Event) // event has been dropped, while waiting for the broker }
ClientEventer provides access to internal client events.
type Event ¶
type Event struct { Timestamp time.Time Meta common.MapStr Fields common.MapStr Private interface{} // for beats private use }
Event is the common event format shared by all beats. Every event must have a timestamp and provide encodable Fields in `Fields`. The `Meta`-fields can be used to pass additional meta-data to the outputs. Output can optionally publish a subset of Meta, or ignore Meta.
type Pipeline ¶
type Pipeline interface { Close() error Connect() (Client, error) ConnectWith(ClientConfig) (Client, error) SetACKHandler(PipelineACKHandler) error }
type PipelineACKHandler ¶
type PipelineACKHandler struct { // ACKCount reports the number of published events recently acknowledged // by the pipeline. ACKCount func(int) // ACKEvents reports the events recently acknowledged by the pipeline. ACKEvents func([]Event) // ACKLastEvent reports the last ACKed event per pipeline client. ACKLastEvents func([]Event) }
PipelineACKHandler configures some pipeline-wide event ACK handler.
type Processor ¶
type Processor interface { String() string // print full processor description Run(in *Event) (event *Event, err error) }
Processor defines the minimal required interface for processor, that can be registered with the publisher pipeline.
type ProcessorList ¶
type ProcessorList interface {
All() []Processor
}
type PublishMode ¶
type PublishMode uint8
PublishMode enum sets some requirements on the client connection to the beats publisher pipeline
const ( // DefaultGuarantees are up to the pipeline configuration, as configured by the // operator. DefaultGuarantees PublishMode = iota // GuaranteedSend ensures events are retried until acknowledged by the output. // Normally guaranteed sending should be used with some client ACK-handling // to update state keeping track of the sending status. GuaranteedSend // DropIfFull drops an event to be send if the pipeline is currently full. // This ensures a beats internals can continue processing if the pipeline has // filled up. Usefull if an event stream must be processed to keep internal // state up-to-date. DropIfFull )