Documentation
¶
Index ¶
- Constants
- func GetExprEnv(e *entry.Entry) map[string]interface{}
- func JSONUnmarshalerHook() mapstructure.DecodeHookFunc
- func NewLineEndSplitFunc(re *regexp.Regexp, flushAtEOF bool, force *Flusher) bufio.SplitFunc
- func NewLineStartSplitFunc(re *regexp.Regexp, flushAtEOF bool, force *Flusher) bufio.SplitFunc
- func NewNewlineSplitFunc(encoding encoding.Encoding, flushAtEOF bool, force *Flusher) (bufio.SplitFunc, error)
- func PutExprEnv(e map[string]interface{})
- func SplitNone(maxLogSize int) bufio.SplitFunc
- func UnmarshalMapstructure(input interface{}, result interface{}) error
- type Attributer
- type AttributerConfig
- type BasicConfig
- type BasicOperator
- type ByteSize
- type Duration
- type Encoding
- type EncodingConfig
- type ExprString
- type ExprStringConfig
- type Flusher
- type FlusherConfig
- type HostIdentifier
- type HostIdentifierConfig
- type IPResolver
- type Identifier
- type IdentifierConfig
- type InputConfig
- type InputOperator
- type Multiline
- type MultilineConfig
- type OutputConfig
- type OutputIDs
- type OutputOperator
- func (o *OutputOperator) CanOutput() bool
- func (o *OutputOperator) CanProcess() bool
- func (o *OutputOperator) GetOutputIDs() []string
- func (o *OutputOperator) Outputs() []operator.Operator
- func (o *OutputOperator) SetOutputIDs(opIDs []string)
- func (o *OutputOperator) SetOutputs(operators []operator.Operator) error
- type ParseFunction
- type ParserConfig
- type ParserOperator
- func (p *ParserOperator) ParseWith(ctx context.Context, entry *entry.Entry, parse ParseFunction) error
- func (p *ParserOperator) ProcessWith(ctx context.Context, entry *entry.Entry, parse ParseFunction) error
- func (p *ParserOperator) ProcessWithCallback(ctx context.Context, entry *entry.Entry, parse ParseFunction, ...) error
- type SeverityParser
- type SeverityParserConfig
- type SpanIdConfig
- type Splitter
- type SplitterConfig
- type TLSServerConfig
- type TimeParser
- type TraceFlagsConfig
- type TraceIdConfig
- type TraceParser
- type TransformFunction
- type TransformerConfig
- type TransformerOperator
- func (t *TransformerOperator) CanProcess() bool
- func (t *TransformerOperator) HandleEntryError(ctx context.Context, entry *entry.Entry, err error) error
- func (t *TransformerOperator) ProcessWith(ctx context.Context, entry *entry.Entry, transform TransformFunction) error
- func (t *TransformerOperator) Skip(ctx context.Context, entry *entry.Entry) (bool, error)
- type WriterConfig
- type WriterOperator
- func (w *WriterOperator) CanOutput() bool
- func (w *WriterOperator) GetOutputIDs() []string
- func (w *WriterOperator) Outputs() []operator.Operator
- func (w *WriterOperator) SetOutputIDs(opIds []string)
- func (w *WriterOperator) SetOutputs(operators []operator.Operator) error
- func (w *WriterOperator) Write(ctx context.Context, e *entry.Entry)
Constants ¶
const ( // HTTP2xx is a special key that is represents a range from 200 to 299. Literal value is "2xx" HTTP2xx = "2xx" // HTTP3xx is a special key that is represents a range from 300 to 399. Literal value is "3xx" HTTP3xx = "3xx" // HTTP4xx is a special key that is represents a range from 400 to 499. Literal value is "4xx" HTTP4xx = "4xx" // HTTP5xx is a special key that is represents a range from 500 to 599. Literal value is "5xx" HTTP5xx = "5xx" )
const DropOnError = "drop"
DropOnError specifies an on_error mode for dropping entries after an error.
const EpochKey = "epoch"
EpochKey is literally "epoch" and can parse seconds and/or subseconds
const GotimeKey = "gotime"
GotimeKey is literally "gotime" and uses Golang's native time.Parse
const NativeKey = "native" // provided for operator development
NativeKey is literally "native" and refers to Golang's native time.Time
const SendOnError = "send"
SendOnError specifies an on_error mode for sending entries after an error.
const StrptimeKey = "strptime"
StrptimeKey is literally "strptime", and is the default layout type
Variables ¶
This section is empty.
Functions ¶
func GetExprEnv ¶
GetExprEnv returns a map of key/value pairs that can be be used to evaluate an expression
func JSONUnmarshalerHook ¶ added in v0.16.0
func JSONUnmarshalerHook() mapstructure.DecodeHookFunc
make mapstructure use struct UnmarshalJSON to decode
func NewLineEndSplitFunc ¶ added in v0.18.0
NewLineEndSplitFunc creates a bufio.SplitFunc that splits an incoming stream into tokens that end with a match to the regex pattern provided
func NewLineStartSplitFunc ¶ added in v0.18.0
NewLineStartSplitFunc creates a bufio.SplitFunc that splits an incoming stream into tokens that start with a match to the regex pattern provided
func NewNewlineSplitFunc ¶ added in v0.18.0
func NewNewlineSplitFunc(encoding encoding.Encoding, flushAtEOF bool, force *Flusher) (bufio.SplitFunc, error)
NewNewlineSplitFunc splits log lines by newline, just as bufio.ScanLines, but never returning an token using EOF as a terminator
func PutExprEnv ¶
func PutExprEnv(e map[string]interface{})
PutExprEnv adds a key/value pair that will can be used to evaluate an expression
func SplitNone ¶ added in v0.22.0
SplitNone doesn't split any of the bytes, it reads in all of the bytes and returns it all at once. This is for when the encoding is nop
func UnmarshalMapstructure ¶ added in v0.17.0
func UnmarshalMapstructure(input interface{}, result interface{}) error
Types ¶
type Attributer ¶ added in v0.16.0
type Attributer struct {
// contains filtered or unexported fields
}
Attributer is a helper that adds attributes to an entry
type AttributerConfig ¶ added in v0.16.0
type AttributerConfig struct {
Attributes map[string]ExprStringConfig `mapstructure:"attributes" json:"attributes" yaml:"attributes"`
}
AttributerConfig is the configuration of a attributer
func NewAttributerConfig ¶ added in v0.16.0
func NewAttributerConfig() AttributerConfig
NewAttributerConfig creates a new attributer config with default values
func (AttributerConfig) Build ¶ added in v0.16.0
func (c AttributerConfig) Build() (Attributer, error)
Build will build a attributer from the supplied configuration
type BasicConfig ¶
type BasicConfig struct { OperatorID string `mapstructure:"id" json:"id" yaml:"id"` OperatorType string `mapstructure:"type" json:"type" yaml:"type"` }
BasicConfig provides a basic implemention for an operator config.
func NewBasicConfig ¶
func NewBasicConfig(operatorID, operatorType string) BasicConfig
NewBasicConfig creates a new basic config
func (BasicConfig) Build ¶
func (c BasicConfig) Build(context operator.BuildContext) (BasicOperator, error)
Build will build a basic operator.
func (*BasicConfig) SetID ¶ added in v0.21.0
func (c *BasicConfig) SetID(id string)
SetID will Update the operator id.
type BasicOperator ¶
type BasicOperator struct { OperatorID string OperatorType string *zap.SugaredLogger }
BasicOperator provides a basic implementation of an operator.
func (*BasicOperator) Logger ¶
func (p *BasicOperator) Logger() *zap.SugaredLogger
Logger returns the operator's scoped logger.
func (*BasicOperator) Start ¶
func (p *BasicOperator) Start(_ operator.Persister) error
Start will start the operator.
func (*BasicOperator) Type ¶
func (p *BasicOperator) Type() string
Type will return the operator type.
type ByteSize ¶
type ByteSize int64
func (*ByteSize) UnmarshalJSON ¶
func (*ByteSize) UnmarshalText ¶ added in v0.17.0
func (*ByteSize) UnmarshalYAML ¶
type Duration ¶
Duration is the representation of a length of time
func NewDuration ¶
NewDuration creates a new duration from a time
func (Duration) MarshalJSON ¶
MarshalJSON will marshal the duration as a json string
func (Duration) MarshalYAML ¶
MarshalYAML will marshal the duration as a yaml string
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON will unmarshal json as a duration
func (*Duration) UnmarshalYAML ¶
UnmarshalYAML will unmarshal yaml as a duration
type EncodingConfig ¶ added in v0.18.0
type EncodingConfig struct {
Encoding string `mapstructure:"encoding,omitempty" json:"encoding,omitempty" yaml:"encoding,omitempty"`
}
EncodingConfig is the configuration of a Encoding helper
func NewEncodingConfig ¶ added in v0.18.0
func NewEncodingConfig() EncodingConfig
NewBasicConfig creates a new Encoding config
func (EncodingConfig) Build ¶ added in v0.18.0
func (c EncodingConfig) Build(context operator.BuildContext) (Encoding, error)
Build will build an Encoding operator.
type ExprString ¶
An ExprString is made up of a list of string literals interleaved with expressions. len(SubStrings) == len(SubExprs) + 1
type ExprStringConfig ¶
type ExprStringConfig string
ExprStringConfig is a string that represents an expression
func (ExprStringConfig) Build ¶
func (e ExprStringConfig) Build() (*ExprString, error)
Build creates an ExprStr string from the specified config
type Flusher ¶ added in v0.20.0
type Flusher struct {
// contains filtered or unexported fields
}
Flusher keeps information about flush state
func NewFlusher ¶ added in v0.20.0
NewFlusher Creates new Flusher with lastFlush set to unix epoch and order to not force ongoing flush
func (*Flusher) CheckAndFlush ¶ added in v0.20.0
func (f *Flusher) CheckAndFlush()
CheckAndFlush sets internal flag to true if data is going to be force flushed
func (*Flusher) Flushed ¶ added in v0.20.0
func (f *Flusher) Flushed()
Flushed update lastFlush with current timestamp
func (*Flusher) ForceFlushed ¶ added in v0.20.0
func (f *Flusher) ForceFlushed()
ForceFlushed update struct fields after forced flush
func (*Flusher) ShouldFlush ¶ added in v0.20.0
ShouldFlush returns true if data should be forcefully flushed
type FlusherConfig ¶ added in v0.20.0
type FlusherConfig struct {
Period Duration `mapstructure:"force_flush_period" json:"force_flush_period" yaml:"force_flush_period"`
}
FlusherConfig is a configuration of Flusher helper
func NewFlusherConfig ¶ added in v0.20.0
func NewFlusherConfig() FlusherConfig
NewFlusherConfig creates a default Flusher config
func (*FlusherConfig) Build ¶ added in v0.20.0
func (c *FlusherConfig) Build() *Flusher
Build creates Flusher from configuration
type HostIdentifier ¶
type HostIdentifier struct {
// contains filtered or unexported fields
}
HostIdentifier is a helper that adds host related metadata to an entry's resource
func (*HostIdentifier) Identify ¶
func (h *HostIdentifier) Identify(entry *entry.Entry)
Identify will add host related metadata to an entry's resource
type HostIdentifierConfig ¶
type HostIdentifierConfig struct { IncludeHostname bool `json:"include_hostname,omitempty" yaml:"include_hostname,omitempty"` IncludeIP bool `json:"include_ip,omitempty" yaml:"include_ip,omitempty"` // contains filtered or unexported fields }
HostIdentifierConfig is the configuration of a host identifier
func NewHostIdentifierConfig ¶
func NewHostIdentifierConfig() HostIdentifierConfig
NewHostIdentifierConfig returns a HostIdentifierConfig with default values
func (HostIdentifierConfig) Build ¶
func (c HostIdentifierConfig) Build() (HostIdentifier, error)
Build will build a host attributer from the supplied configuration
type IPResolver ¶ added in v0.19.0
type IPResolver struct {
// contains filtered or unexported fields
}
func (*IPResolver) GetHostFromIp ¶ added in v0.19.0
func (r *IPResolver) GetHostFromIp(ip string) (host string)
GetHostFromIp returns hostname for given ip It is taken from cache if exists, otherwise lookup is performed and result is put into cache
type Identifier ¶
type Identifier struct {
// contains filtered or unexported fields
}
Identifier is a helper that adds values to the resource of an entry
type IdentifierConfig ¶
type IdentifierConfig struct {
Resource map[string]ExprStringConfig `mapstructure:"resource" json:"resource" yaml:"resource"`
}
IdentifierConfig is the configuration of a resource identifier
func NewIdentifierConfig ¶
func NewIdentifierConfig() IdentifierConfig
NewIdentifierConfig creates a new identifier config with default values
func (IdentifierConfig) Build ¶
func (c IdentifierConfig) Build() (Identifier, error)
Build will build an identifier from the supplied configuration
type InputConfig ¶
type InputConfig struct { AttributerConfig `mapstructure:",squash" yaml:",inline"` IdentifierConfig `mapstructure:",squash" yaml:",inline"` WriterConfig `mapstructure:",squash" yaml:",inline"` WriteTo entry.Field `mapstructure:"write_to" json:"write_to" yaml:"write_to"` }
InputConfig provides a basic implementation of an input operator config.
func NewInputConfig ¶
func NewInputConfig(operatorID, operatorType string) InputConfig
NewInputConfig creates a new input config with default values.
func (InputConfig) Build ¶
func (c InputConfig) Build(context operator.BuildContext) (InputOperator, error)
Build will build a base producer.
type InputOperator ¶
type InputOperator struct { Attributer Identifier WriterOperator WriteTo entry.Field }
InputOperator provides a basic implementation of an input operator.
func (*InputOperator) CanProcess ¶
func (i *InputOperator) CanProcess() bool
CanProcess will always return false for an input operator.
type Multiline ¶ added in v0.20.0
Multiline consists of splitFunc and variables needed to perform force flush
type MultilineConfig ¶ added in v0.18.0
type MultilineConfig struct { LineStartPattern string `mapstructure:"line_start_pattern" json:"line_start_pattern" yaml:"line_start_pattern"` LineEndPattern string `mapstructure:"line_end_pattern" json:"line_end_pattern" yaml:"line_end_pattern"` }
MultilineConfig is the configuration of a multiline helper
func NewMultilineConfig ¶ added in v0.18.0
func NewMultilineConfig() MultilineConfig
NewBasicConfig creates a new Multiline config
type OutputConfig ¶
type OutputConfig struct {
BasicConfig `mapstructure:",squash" yaml:",inline"`
}
OutputConfig provides a basic implementation of an output operator config.
func NewOutputConfig ¶
func NewOutputConfig(operatorID, operatorType string) OutputConfig
NewOutputConfig creates a new output config
func (OutputConfig) Build ¶
func (c OutputConfig) Build(context operator.BuildContext) (OutputOperator, error)
Build will build an output operator.
func (OutputConfig) BuildsMultipleOps ¶ added in v0.19.0
func (c OutputConfig) BuildsMultipleOps() bool
BuildsMultipleOps Returns false
type OutputIDs ¶
type OutputIDs []string
OutputIDs is a collection of operator IDs used as outputs.
func NewOutputIDsFromArray ¶
NewOutputIDsFromArray creates a new OutputIDs object from an array
func NewOutputIDsFromInterface ¶
NewOutputIDsFromInterface creates a new OutputIDs object from an interface
func (*OutputIDs) UnmarshalJSON ¶
UnmarshalJSON will unmarshal a string or array of strings to OutputIDs.
func (*OutputIDs) UnmarshalYAML ¶
UnmarshalYAML will unmarshal a string or array of strings to OutputIDs.
func (OutputIDs) WithNamespace ¶
func (o OutputIDs) WithNamespace(bc operator.BuildContext) OutputIDs
type OutputOperator ¶
type OutputOperator struct {
BasicOperator
}
OutputOperator provides a basic implementation of an output operator.
func (*OutputOperator) CanOutput ¶
func (o *OutputOperator) CanOutput() bool
CanOutput will always return false for an output operator.
func (*OutputOperator) CanProcess ¶
func (o *OutputOperator) CanProcess() bool
CanProcess will always return true for an output operator.
func (*OutputOperator) GetOutputIDs ¶ added in v0.19.0
func (o *OutputOperator) GetOutputIDs() []string
GetOutputIDs will always return an empty array for an output ID.
func (*OutputOperator) Outputs ¶
func (o *OutputOperator) Outputs() []operator.Operator
Outputs will always return an empty array for an output operator.
func (*OutputOperator) SetOutputIDs ¶ added in v0.19.0
func (o *OutputOperator) SetOutputIDs(opIDs []string)
SetOutputIDs will return nothing and does nothing.
func (*OutputOperator) SetOutputs ¶
func (o *OutputOperator) SetOutputs(operators []operator.Operator) error
SetOutputs will return an error if called.
type ParseFunction ¶
type ParseFunction = func(interface{}) (interface{}, error)
ParseFunction is function that parses a raw value.
type ParserConfig ¶
type ParserConfig struct { TransformerConfig `mapstructure:",squash" yaml:",inline"` ParseFrom entry.Field `mapstructure:"parse_from" json:"parse_from" yaml:"parse_from"` ParseTo entry.Field `mapstructure:"parse_to" json:"parse_to" yaml:"parse_to"` PreserveTo *entry.Field `mapstructure:"preserve_to" json:"preserve_to" yaml:"preserve_to"` TimeParser *TimeParser `mapstructure:"timestamp,omitempty" json:"timestamp,omitempty" yaml:"timestamp,omitempty"` SeverityParserConfig *SeverityParserConfig `mapstructure:"severity,omitempty" json:"severity,omitempty" yaml:"severity,omitempty"` TraceParser *TraceParser `mapstructure:"trace,omitempty" json:"trace,omitempty" yaml:"trace,omitempty"` }
ParserConfig provides the basic implementation of a parser config.
func NewParserConfig ¶
func NewParserConfig(operatorID, operatorType string) ParserConfig
NewParserConfig creates a new parser config with default values
func (ParserConfig) Build ¶
func (c ParserConfig) Build(context operator.BuildContext) (ParserOperator, error)
Build will build a parser operator.
type ParserOperator ¶
type ParserOperator struct { TransformerOperator ParseFrom entry.Field ParseTo entry.Field PreserveTo *entry.Field TimeParser *TimeParser SeverityParser *SeverityParser TraceParser *TraceParser }
ParserOperator provides a basic implementation of a parser operator.
func (*ParserOperator) ParseWith ¶
func (p *ParserOperator) ParseWith(ctx context.Context, entry *entry.Entry, parse ParseFunction) error
ParseWith will process an entry's field with a parser function.
func (*ParserOperator) ProcessWith ¶
func (p *ParserOperator) ProcessWith(ctx context.Context, entry *entry.Entry, parse ParseFunction) error
ProcessWith will run ParseWith on the entry, then forward the entry on to the next operators.
func (*ParserOperator) ProcessWithCallback ¶ added in v0.15.1
func (p *ParserOperator) ProcessWithCallback(ctx context.Context, entry *entry.Entry, parse ParseFunction, cb func(*entry.Entry) error) error
type SeverityParser ¶
SeverityParser is a helper that parses severity onto an entry.
type SeverityParserConfig ¶
type SeverityParserConfig struct { ParseFrom *entry.Field `mapstructure:"parse_from,omitempty" json:"parse_from,omitempty" yaml:"parse_from,omitempty"` PreserveTo *entry.Field `mapstructure:"preserve_to,omitempty" json:"preserve_to,omitempty" yaml:"preserve_to,omitempty"` Preset string `mapstructure:"preset,omitempty" json:"preset,omitempty" yaml:"preset,omitempty"` Mapping map[interface{}]interface{} `mapstructure:"mapping,omitempty" json:"mapping,omitempty" yaml:"mapping,omitempty"` }
SeverityParserConfig allows users to specify how to parse a severity from a field.
func NewSeverityParserConfig ¶
func NewSeverityParserConfig() SeverityParserConfig
NewSeverityParserConfig creates a new severity parser config
func (*SeverityParserConfig) Build ¶
func (c *SeverityParserConfig) Build(context operator.BuildContext) (SeverityParser, error)
Build builds a SeverityParser from a SeverityParserConfig
type SpanIdConfig ¶ added in v0.17.0
type Splitter ¶ added in v0.20.0
Splitter consolidates Flusher and dependent splitFunc
func (*Splitter) CheckAndFlush ¶ added in v0.20.0
func (s *Splitter) CheckAndFlush()
CheckAndFlush instructs Flusher to check if next log should be forcefully flushed and set appropriate flags if yes
type SplitterConfig ¶ added in v0.20.0
type SplitterConfig struct { Multiline MultilineConfig `` /* 129-byte string literal not displayed */ Flusher FlusherConfig `` /* 127-byte string literal not displayed */ }
SplitterConfig consolidates MultilineConfig and FlusherConfig
func NewSplitterConfig ¶ added in v0.20.0
func NewSplitterConfig() SplitterConfig
NewSplitterConfig returns default SplitterConfig
type TLSServerConfig ¶ added in v0.17.0
type TLSServerConfig struct {
*configtls.TLSServerSetting `mapstructure:",squash" json:",inline" yaml:",inline"`
}
func NewTLSServerConfig ¶ added in v0.17.0
func NewTLSServerConfig(setting *configtls.TLSServerSetting) *TLSServerConfig
func (*TLSServerConfig) UnmarshalYAML ¶ added in v0.17.0
func (t *TLSServerConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
type TimeParser ¶
type TimeParser struct { ParseFrom *entry.Field `mapstructure:"parse_from,omitempty" json:"parse_from,omitempty" yaml:"parse_from,omitempty"` Layout string `mapstructure:"layout,omitempty" json:"layout,omitempty" yaml:"layout,omitempty"` LayoutType string `mapstructure:"layout_type,omitempty" json:"layout_type,omitempty" yaml:"layout_type,omitempty"` PreserveTo *entry.Field `mapstructure:"preserve_to,omitempty" json:"preserve_to,omitempty" yaml:"preserve_to,omitempty"` Location string `mapstructure:"location,omitempty" json:"location,omitempty" yaml:"location,omitempty"` // contains filtered or unexported fields }
TimeParser is a helper that parses time onto an entry.
func NewTimeParser ¶
func NewTimeParser() TimeParser
NewTimeParser creates a new time parser with default values
func (*TimeParser) IsZero ¶
func (t *TimeParser) IsZero() bool
IsZero returns true if the TimeParser is not a valid config
func (*TimeParser) Parse ¶
func (t *TimeParser) Parse(entry *entry.Entry) error
Parse will parse time from a field and attach it to the entry
func (*TimeParser) Validate ¶
func (t *TimeParser) Validate(context operator.BuildContext) error
Validate validates a TimeParser, and reconfigures it if necessary
type TraceFlagsConfig ¶ added in v0.17.0
type TraceIdConfig ¶ added in v0.17.0
type TraceParser ¶ added in v0.17.0
type TraceParser struct { TraceId *TraceIdConfig `mapstructure:"trace_id,omitempty" json:"trace_id,omitempty" yaml:"trace_id,omitempty"` SpanId *SpanIdConfig `mapstructure:"span_id,omitempty" json:"span_id,omitempty" yaml:"span_id,omitempty"` TraceFlags *TraceFlagsConfig `mapstructure:"trace_flags,omitempty" json:"trace_flags,omitempty" yaml:"trace_flags,omitempty"` }
TraceParser is a helper that parses trace spans (and flags) onto an entry.
func NewTraceParser ¶ added in v0.17.0
func NewTraceParser() TraceParser
NewTraceParser creates a new trace parser with default values
func (*TraceParser) Parse ¶ added in v0.17.0
func (t *TraceParser) Parse(entry *entry.Entry) error
Parse will parse a trace (trace_id, span_id and flags) from a field and attach it to the entry
func (*TraceParser) Validate ¶ added in v0.17.0
func (t *TraceParser) Validate(context operator.BuildContext) error
Validate validates a TraceParser, and reconfigures it if necessary
type TransformFunction ¶
TransformFunction is function that transforms an entry.
type TransformerConfig ¶
type TransformerConfig struct { WriterConfig `mapstructure:",squash" yaml:",inline"` OnError string `mapstructure:"on_error" json:"on_error" yaml:"on_error"` IfExpr string `mapstructure:"if" json:"if" yaml:"if"` }
TransformerConfig provides a basic implementation of a transformer config.
func NewTransformerConfig ¶
func NewTransformerConfig(operatorID, operatorType string) TransformerConfig
NewTransformerConfig creates a new transformer config with default values
func (TransformerConfig) Build ¶
func (c TransformerConfig) Build(context operator.BuildContext) (TransformerOperator, error)
Build will build a transformer operator.
type TransformerOperator ¶
type TransformerOperator struct { WriterOperator OnError string IfExpr *vm.Program }
TransformerOperator provides a basic implementation of a transformer operator.
func (*TransformerOperator) CanProcess ¶
func (t *TransformerOperator) CanProcess() bool
CanProcess will always return true for a transformer operator.
func (*TransformerOperator) HandleEntryError ¶
func (t *TransformerOperator) HandleEntryError(ctx context.Context, entry *entry.Entry, err error) error
HandleEntryError will handle an entry error using the on_error strategy.
func (*TransformerOperator) ProcessWith ¶
func (t *TransformerOperator) ProcessWith(ctx context.Context, entry *entry.Entry, transform TransformFunction) error
ProcessWith will process an entry with a transform function.
type WriterConfig ¶
type WriterConfig struct { BasicConfig `mapstructure:",squash" yaml:",inline"` OutputIDs OutputIDs `mapstructure:"output" json:"output" yaml:"output"` }
WriterConfig is the configuration of a writer operator.
func NewWriterConfig ¶
func NewWriterConfig(operatorID, operatorType string) WriterConfig
NewWriterConfig creates a new writer config
func (WriterConfig) Build ¶
func (c WriterConfig) Build(bc operator.BuildContext) (WriterOperator, error)
Build will build a writer operator from the config.
func (WriterConfig) BuildsMultipleOps ¶ added in v0.19.0
func (c WriterConfig) BuildsMultipleOps() bool
BuildsMultipleOps Returns false as a base line
type WriterOperator ¶
type WriterOperator struct { BasicOperator OutputIDs OutputIDs OutputOperators []operator.Operator }
WriterOperator is an operator that can write to other operators.
func (*WriterOperator) CanOutput ¶
func (w *WriterOperator) CanOutput() bool
CanOutput always returns true for a writer operator.
func (*WriterOperator) GetOutputIDs ¶ added in v0.19.0
func (w *WriterOperator) GetOutputIDs() []string
GetOutputIDs returns the output IDs of the writer operator.
func (*WriterOperator) Outputs ¶
func (w *WriterOperator) Outputs() []operator.Operator
Outputs returns the outputs of the writer operator.
func (*WriterOperator) SetOutputIDs ¶ added in v0.19.0
func (w *WriterOperator) SetOutputIDs(opIds []string)
SetOutputIDs will set the outputs of the operator.
func (*WriterOperator) SetOutputs ¶
func (w *WriterOperator) SetOutputs(operators []operator.Operator) error
SetOutputs will set the outputs of the operator.