outputs

package
v5.5.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotACertificate indicates a PEM file to be loaded not being a valid
	// PEM file or certificate.
	ErrNotACertificate = errors.New("file is not a certificate")

	// ErrCertificateNoKey indicate a configuration error with missing key file
	ErrCertificateNoKey = errors.New("key file not configured")

	// ErrKeyNoCertificate indicate a configuration error with missing certificate file
	ErrKeyNoCertificate = errors.New("certificate file not configured")
)

Functions

func GetMetadata

func GetMetadata(v *Values) common.MapStr

func LoadTLSConfig

func LoadTLSConfig(config *TLSConfig) (*transport.TLSConfig, error)

LoadTLSConfig will load a certificate from config with all TLS based keys defined. If Certificate and CertificateKey are configured, client authentication will be configured. If no CAs are configured, the host CA will be used by go built-in TLS support.

func Plugin

func Plugin(name string, l OutputBuilder) map[string][]interface{}

func RegisterOutputCodec

func RegisterOutputCodec(name string, gen CodecFactory)

func RegisterOutputPlugin

func RegisterOutputPlugin(name string, builder OutputBuilder)

Types

type BulkOutputer

type BulkOutputer interface {
	Outputer
	BulkPublish(sig op.Signaler, opts Options, data []Data) error
}

BulkOutputer adds BulkPublish to publish batches of events without looping. Outputers still might loop on events or use more efficient bulk-apis if present.

func CastBulkOutputer

func CastBulkOutputer(out Outputer) BulkOutputer

CastBulkOutputer casts out into a BulkOutputer if out implements the BulkOutputer interface. If out does not implement the interface an outputer wrapper implementing the BulkOutputer interface is returned.

type CertificateConfig

type CertificateConfig struct {
	Certificate string `config:"certificate"`
	Key         string `config:"key"`
	Passphrase  string `config:"key_passphrase"`
}

type Codec

type Codec interface {
	Encode(Event common.MapStr) ([]byte, error)
}

func CreateEncoder

func CreateEncoder(cfg CodecConfig) (Codec, error)

type CodecConfig

type CodecConfig struct {
	Namespace common.ConfigNamespace `config:",inline"`
}

type CodecFactory

type CodecFactory func(*common.Config) (Codec, error)

type Data

type Data struct {
	// Holds the beats published event and MUST be used read-only manner only in
	// output plugins.
	Event common.MapStr

	// `Values` can be used to store additional context-dependent metadata
	// within Data. With `Data` being copied to each output, it is safe to update
	// `Data.Values` itself in outputs, but access to actually stored values must
	// be thread-safe: read-only if key might be shared or read/write if value key
	// is local to output plugin.
	Values *Values
}

Data contains the Event and additional values shared/populated by outputs to share state internally in output plugins for example between retries.

Values of type Data are pushed by value inside the publisher chain up to the outputs. If multiple outputs are configured, each will receive a copy of Data elemets.

func (*Data) AddValue

func (d *Data) AddValue(key, value interface{})

type EventEncoder

type EventEncoder interface {
	// Encode event
	Encode(event common.MapStr, options interface{}) ([]byte, error)
}

type EventFormatter

type EventFormatter interface {
	// Format event
	Format(event common.MapStr, format string) ([]byte, error)
}

type Options

type Options struct {
	Guaranteed bool
}

type OutputBuilder

type OutputBuilder func(beatName string, config *common.Config, topologyExpire int) (Outputer, error)

Create and initialize the output plugin

func FindOutputPlugin

func FindOutputPlugin(name string) OutputBuilder

type OutputInterface

type OutputInterface interface {
	Outputer
	TopologyOutputer
}

Functions to be exported by a output plugin

type OutputPlugin

type OutputPlugin struct {
	Name   string
	Config *common.Config
	Output Outputer
}

func InitOutputs

func InitOutputs(
	beatName string,
	configs map[string]*common.Config,
	topologyExpire int,
) ([]OutputPlugin, error)

type Outputer

type Outputer interface {
	// Publish event
	PublishEvent(sig op.Signaler, opts Options, data Data) error

	Close() error
}

type TLSConfig

type TLSConfig struct {
	Enabled          *bool                         `config:"enabled"`
	VerificationMode transport.TLSVerificationMode `config:"verification_mode"` // one of 'none', 'full'
	Versions         []transport.TLSVersion        `config:"supported_protocols"`
	CipherSuites     []tlsCipherSuite              `config:"cipher_suites"`
	CAs              []string                      `config:"certificate_authorities"`
	Certificate      CertificateConfig             `config:",inline"`
	CurveTypes       []tlsCurveType                `config:"curve_types"`
}

TLSConfig defines config file options for TLS clients.

func (*TLSConfig) IsEnabled

func (c *TLSConfig) IsEnabled() bool

func (*TLSConfig) Validate

func (c *TLSConfig) Validate() error

type TopologyOutputer

type TopologyOutputer interface {
	// Register the agent name and its IPs to the topology map
	PublishIPs(name string, localAddrs []string) error

	// Get the agent name with a specific IP from the topology map
	GetNameByIP(ip string) string
}

type Values

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

Values is a recursive key/value store for use by output plugins and publisher pipeline to share context-dependent values.

func ValueWith

func ValueWith(parent *Values, key interface{}, value interface{}) *Values

ValueWith creates new key/value store shadowing potentially old keys.

func ValuesWithMetadata

func ValuesWithMetadata(parent *Values, meta common.MapStr) *Values

func (*Values) Append

func (v *Values) Append(key, value interface{}) *Values

Append creates new key/value store from existing store by adding a new key/value pair potentially shadowing an already present key/value pair.

func (*Values) Get

func (v *Values) Get(key interface{}) (interface{}, bool)

Get retrieves a value for the given key.

func (*Values) IsEmpty

func (v *Values) IsEmpty() bool

IsEmpty returns true if key/value store is empty.

Directories

Path Synopsis
Package mode defines and implents output strategies with failover or load balancing modes for use by output plugins.
Package mode defines and implents output strategies with failover or load balancing modes for use by output plugins.
lb

Jump to

Keyboard shortcuts

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