Documentation ¶
Index ¶
Constants ¶
View Source
const ( CfgSourceRattr string = "rattr" CfgSourceAttr string = "attr" CfgSourceBody string = "body" CfgSourceLit string = "lit" CfgFormatMessage string = "message" CfgFormatContainer string = "container" CfgFormatEvent string = "event" CfgOpRmprefix string = "rmprefix" CfgOpRmsuffix string = "rmsuffix" CfgOpRmtail string = "rmtail" CfgOpAlphaNum string = "alphanum" CfgOpLc string = "lc" CfgOpUnescape string = "unescape" CfgOpReplace string = "replace" CfgOpRegexp string = "regexp" CfgOpAnd string = "and" CfgOpOr string = "or" )
View Source
const CMaxNumExps = 10
Variables ¶
This section is empty.
Functions ¶
func FilterASCII ¶
func NewFactory ¶
NewFactory returns a new factory for the Batch processor.
Types ¶
type Config ¶
type Config struct { // Science Logic input profiles Profiles []ConfigProfile `mapstructure:"profiles"` // Timeout sets the time after which a batch will be sent regardless of size. Timeout time.Duration `mapstructure:"timeout"` // SendBatchSize is the size of a batch which after hit, will trigger it to be sent. SendBatchSize uint32 `mapstructure:"send_batch_size"` // SendBatchMaxSize is the maximum size of a batch. It must be larger than SendBatchSize. // Larger batches are split into smaller units. // Default value is 0, that means no maximum size. SendBatchMaxSize uint32 `mapstructure:"send_batch_max_size"` }
Config defines configuration for batch processor.
func (*Config) MatchProfile ¶
func (c *Config) MatchProfile(log *zap.Logger, rl plog.ResourceLogs, ils plog.ScopeLogs, lr plog.LogRecord) (*ConfigResult, *StreamTokenReq, error)
type ConfigAttribute ¶
type ConfigAttribute struct { Exp *ConfigExpression `mapstructure:"exp"` Rename string `mapstructure:"rename"` Validate string `mapstructure:"validate"` }
type ConfigExpression ¶
type ConfigExpression struct { Source string `mapstructure:"source"` Op string `mapstructure:"op"` Exps []*ConfigExpression `mapstructure:"exps"` }
type ConfigProfile ¶
type ConfigProfile struct { ServiceGroup *ConfigAttribute `mapstructure:"service_group"` Host *ConfigAttribute `mapstructure:"host"` Logbasename *ConfigAttribute `mapstructure:"logbasename"` Severity *ConfigAttribute `mapstructure:"severity"` Labels []*ConfigAttribute `mapstructure:"labels"` Message *ConfigAttribute `mapstructure:"message"` Format string `mapstructure:"format"` }
type ConfigResult ¶
type ConfigResult struct { ServiceGroup string `mapstructure:"service_group"` Host string `mapstructure:"host"` Logbasename string `mapstructure:"logbasename"` Severity string `mapstructure:"severity"` Labels []string `mapstructure:"labels"` Message string `mapstructure:"message"` Format string `mapstructure:"format"` }
type ContainerLogEntry ¶
type ContainerLogEntry struct { Log string `json:"log"` Timestamp string `json:"timestamp"` Stream string `json:"stream"` }
A formatted container log entry
type StreamTokenReq ¶
type StreamTokenReq struct { Stream string `json:"stream"` Logbasename string `json:"logbasename"` ContainerLog bool `json:"container_log"` LogType string `json:"log_type"` ForwardedLog bool `json:"forwarded_log"` Tz string `json:"tz"` ZeLogCollectorVers string `json:"Ze_log_collector_vers"` Ids map[string]string `json:"ids"` Cfgs map[string]string `json:"cfgs"` Tags map[string]string `json:"tags"` }
Click to show internal directories.
Click to hide internal directories.