Documentation ¶
Index ¶
- Constants
- func BuildFilterPredicate(filterConfig *FilterConfig) (func([]interface{}) bool, error)
- func BuildKeyValuesPredicate(kvpConfigs []*KeyValuePredicateConfig, matchAll bool) (func([]interface{}) bool, error)
- func BuildLoggerFromSinkConfig(sinkConfig *SinkConfig, captures map[string]*loggers.CaptureLogger) (kitlog.Logger, map[string]*loggers.CaptureLogger, error)
- func BuildOutputLogger(outputConfig *OutputConfig) (kitlog.Logger, error)
- func BuildTransformLogger(transformConfig *TransformConfig, captures map[string]*loggers.CaptureLogger, ...) (kitlog.Logger, map[string]*loggers.CaptureLogger, error)
- type CaptureConfig
- type FileConfig
- type FilterConfig
- type GraylogConfig
- type KeyValuePredicateConfig
- type LabelConfig
- type LoggingConfig
- type LoggingConfigWrapper
- type OutputConfig
- type PruneConfig
- type SinkConfig
- func (sinkConfig *SinkConfig) AddSinks(sinks ...*SinkConfig) *SinkConfig
- func (sinkConfig *SinkConfig) BuildLogger() (kitlog.Logger, map[string]*loggers.CaptureLogger, error)
- func (sinkConfig *SinkConfig) SetOutput(output *OutputConfig) *SinkConfig
- func (sinkConfig *SinkConfig) SetTransform(transform *TransformConfig) *SinkConfig
- type SyslogConfig
- type TransformConfig
Constants ¶
const ( // OutputType NoOutput outputType = "" Graylog outputType = "graylog" Syslog outputType = "syslog" File outputType = "file" Stdout outputType = "stdout" Stderr outputType = "stderr" // TransformType NoTransform transformType = "" // Filter log lines Filter transformType = "filter" // Remove key-val pairs from each log line Prune transformType = "prune" // Add key value pairs to each log line Label transformType = "label" Capture transformType = "capture" IncludeWhenAllMatch filterMode = "include_when_all_match" IncludeWhenAnyMatches filterMode = "include_when_any_matches" ExcludeWhenAllMatch filterMode = "exclude_when_all_match" ExcludeWhenAnyMatches filterMode = "exclude_when_any_matches" )
Variables ¶
This section is empty.
Functions ¶
func BuildFilterPredicate ¶
func BuildFilterPredicate(filterConfig *FilterConfig) (func([]interface{}) bool, error)
func BuildKeyValuesPredicate ¶
func BuildKeyValuesPredicate(kvpConfigs []*KeyValuePredicateConfig, matchAll bool) (func([]interface{}) bool, error)
func BuildLoggerFromSinkConfig ¶
func BuildLoggerFromSinkConfig(sinkConfig *SinkConfig, captures map[string]*loggers.CaptureLogger) (kitlog.Logger, map[string]*loggers.CaptureLogger, error)
func BuildOutputLogger ¶
func BuildOutputLogger(outputConfig *OutputConfig) (kitlog.Logger, error)
func BuildTransformLogger ¶
func BuildTransformLogger(transformConfig *TransformConfig, captures map[string]*loggers.CaptureLogger, outputLogger kitlog.Logger) (kitlog.Logger, map[string]*loggers.CaptureLogger, error)
Types ¶
type CaptureConfig ¶
type CaptureConfig struct { Name string `toml:"name"` BufferCap int `toml:"buffer_cap"` Passthrough bool `toml:"passthrough"` }
Sink configuration types
type FilterConfig ¶
type FilterConfig struct { FilterMode filterMode `toml:"filter_mode"` // Predicates to match a log line against using FilterMode Predicates []*KeyValuePredicateConfig `toml:"predicates"` }
Filter types
type KeyValuePredicateConfig ¶
type KeyValuePredicateConfig struct { KeyRegex string `toml:"key_regex"` ValueRegex string `toml:"value_regex"` }
Generates true if KeyRegex matches a log line key and ValueRegex matches that key's value. If ValueRegex is empty then returns true if any key matches If KeyRegex is empty then returns true if any value matches
type LabelConfig ¶
Transforms
type LoggingConfig ¶
type LoggingConfig struct {
RootSink *SinkConfig `toml:"root_sink,omitempty"`
}
func DefaultClientLoggingConfig ¶
func DefaultClientLoggingConfig() *LoggingConfig
func DefaultNodeLoggingConfig ¶
func DefaultNodeLoggingConfig() *LoggingConfig
func LoggingConfigFromMap ¶
func LoggingConfigFromMap(loggingRootMap map[string]interface{}) (*LoggingConfig, error)
func (*LoggingConfig) RootTOMLString ¶
func (lc *LoggingConfig) RootTOMLString() string
Returns the TOML for a top-level logging config wrapped with [logging]
func (*LoggingConfig) TOMLString ¶
func (lc *LoggingConfig) TOMLString() string
type LoggingConfigWrapper ¶
type LoggingConfigWrapper struct {
Logging *LoggingConfig `toml:"logging"`
}
For encoding a top-level '[logging]' TOML table
type OutputConfig ¶
type OutputConfig struct { OutputType outputType `toml:"output_type"` Format string `toml:"format,omitempty"` *GraylogConfig *FileConfig *SyslogConfig }
Sink configuration types
func FileOutput ¶
func FileOutput(path string) *OutputConfig
func RemoteSyslogOutput ¶
func RemoteSyslogOutput(tag, remoteUrl string) *OutputConfig
func StderrOutput ¶
func StderrOutput() *OutputConfig
func StdoutOutput ¶
func StdoutOutput() *OutputConfig
func SyslogOutput ¶
func SyslogOutput(tag string) *OutputConfig
func (*OutputConfig) SetFormat ¶
func (outputConfig *OutputConfig) SetFormat(format string) *OutputConfig
type SinkConfig ¶
type SinkConfig struct { Transform *TransformConfig `toml:"transform"` Sinks []*SinkConfig `toml:"sinks"` Output *OutputConfig `toml:"output"` }
Sink A Sink describes a logger that logs to zero or one output and logs to zero or more child sinks. before transmitting its log it applies zero or one transforms to the stream of log lines. by chaining together many Sinks arbitrary transforms to and multi
func (*SinkConfig) AddSinks ¶
func (sinkConfig *SinkConfig) AddSinks(sinks ...*SinkConfig) *SinkConfig
func (*SinkConfig) BuildLogger ¶
func (sinkConfig *SinkConfig) BuildLogger() (kitlog.Logger, map[string]*loggers.CaptureLogger, error)
Logger formation
func (*SinkConfig) SetOutput ¶
func (sinkConfig *SinkConfig) SetOutput(output *OutputConfig) *SinkConfig
func (*SinkConfig) SetTransform ¶
func (sinkConfig *SinkConfig) SetTransform(transform *TransformConfig) *SinkConfig
type SyslogConfig ¶
Sink configuration types
type TransformConfig ¶
type TransformConfig struct { TransformType transformType `toml:"transform_type"` *LabelConfig *PruneConfig *CaptureConfig *FilterConfig }
Sink configuration types
func CaptureTransform ¶
func CaptureTransform(name string, bufferCap int, passthrough bool) *TransformConfig
func FilterTransform ¶
func FilterTransform(fmode filterMode, keyvalueRegexes ...string) *TransformConfig
func LabelTransform ¶
func LabelTransform(prefix bool, labelKeyvals ...string) *TransformConfig
func PruneTransform ¶
func PruneTransform(keys ...string) *TransformConfig