Versions in this module Expand all Collapse all v1 v1.1.0 May 14, 2024 v1.0.0 Apr 5, 2024 Changes in this version + const ErrCouldNotCompileJMES + const ErrDropStageEmptyConfig + const ErrDropStageInvalidConfig + const ErrDropStageInvalidRegex + const ErrDropStageNoSourceWithValue + const ErrEmptyJSONStageConfig + const ErrEmptyJSONStageSource + const ErrEmptyLabelStageConfig + const ErrExpressionsRequired + const ErrInvalidLabelName + const ErrMalformedJSON + const ErrSamplingStageInvalidRate + const ErrTimestampContainsYear + const MetricTypeCounter + const MetricTypeGauge + const MetricTypeHistogram + const MinReasonableMaxDistinctLabels + const RFC3339Nano + const ReservedLabelTenantID + const StageTypeCRI + const StageTypeDecolorize + const StageTypeDocker + const StageTypeDrop + const StageTypeEventLogMessage + const StageTypeGeoIP + const StageTypeJSON + const StageTypeLabel + const StageTypeLabelAllow + const StageTypeLabelDrop + const StageTypeLimit + const StageTypeLogfmt + const StageTypeLuhn + const StageTypeMatch + const StageTypeMetric + const StageTypeMultiline + const StageTypeOutput + const StageTypePack + const StageTypePipeline + const StageTypeRegex + const StageTypeReplace + const StageTypeSampling + const StageTypeStaticLabels + const StageTypeStructuredMetadata + const StageTypeTemplate + const StageTypeTenant + const StageTypeTimestamp + var Debug = false + var DefaultCRIConfig = CRIConfig + var DefaultMultilineConfig = MultilineConfig + var DefaultPackConfig = PackConfig + var ErrCouldNotCompileRegex = errors.New("could not compile regular expression") + var ErrEmptyDBPathGeoIPStageConfig = errors.New("db path cannot be empty") + var ErrEmptyDBTypeAndValuesGeoIPStageConfig = errors.New("db type or values need to be set") + var ErrEmptyDBTypeGeoIPStageConfig = errors.New("db type should be either city or asn") + var ErrEmptyGeoIPStageConfig = errors.New("geoip stage config cannot be empty") + var ErrEmptyLabelAllowStageConfig = errors.New("labelallow stage config cannot be empty") + var ErrEmptyLabelDropStageConfig = errors.New("labeldrop stage config cannot be empty") + var ErrEmptyLogfmtStageConfig = errors.New("empty logfmt stage configuration") + var ErrEmptyMatchStageConfig = errors.New("match stage config cannot be empty") + var ErrEmptyMetricsStageConfig = errors.New("empty metric stage configuration") + var ErrEmptyOutputStageConfig = errors.New("output stage config cannot be empty") + var ErrEmptyRegexStageSource = errors.New("empty source") + var ErrEmptyReplaceStageConfig = errors.New("empty replace stage configuration") + var ErrEmptyReplaceStageSource = errors.New("empty source in replace stage") + var ErrEmptySourceGeoIPStageConfig = errors.New("source cannot be empty") + var ErrEmptyStaticLabelStageConfig = errors.New("static_labels stage config cannot be empty") + var ErrEmptyTemplateStageConfig = errors.New("template stage config cannot be empty") + var ErrEmptyTimestampStageConfig = errors.New("timestamp stage config cannot be empty") + var ErrExpressionRequired = errors.New("expression is required") + var ErrInvalidActionOnFailure = errors.New("invalid action on failure (supported values are %v)") + var ErrInvalidIdleDur = errors.New("max_idle_duration could not be parsed as a time.Duration") + var ErrInvalidLocation = errors.New("invalid location specified: %v") + var ErrLimitStageByLabelMustDrop = errors.New("When ratelimiting by label, drop must be true") + var ErrLimitStageInvalidRateOrBurst = errors.New("limit stage failed to parse rate or burst") + var ErrMappingRequired = errors.New("logfmt mapping is required") + var ErrMatchRequiresStages = errors.New(...) + var ErrMetricsStageInvalidType = errors.New("invalid metric type: must be one of 'counter', 'gauge', or 'histogram'") + var ErrMultilineStageEmptyConfig = errors.New("multiline stage config must define `firstline` regular expression") + var ErrMultilineStageInvalidMaxWaitTime = errors.New("multiline stage `max_wait_time` parse error") + var ErrMultilineStageInvalidRegex = errors.New("multiline stage first line regex compilation error") + var ErrOutputSourceRequired = errors.New("output source value is required if output is specified") + var ErrPipelineNameRequired = errors.New("match stage pipeline name can be omitted but cannot be an empty string") + var ErrSelectorRequired = errors.New("selector statement required for match stage") + var ErrSelectorSyntax = errors.New("invalid selector syntax for match stage") + var ErrStagesWithDropLine = errors.New("match stage configured to drop entries cannot contains stages") + var ErrSubSecIdleDur = errors.New("max_idle_duration less than 1s not allowed") + var ErrTemplateSourceRequired = errors.New("template source value is required") + var ErrTenantStageConflictingLabelSourceAndValue = errors.New(...) + var ErrTenantStageEmptyLabelSourceOrValue = errors.New("label, source or value config are required") + var ErrTimestampConversionFailed = errors.New("failed to convert extracted time to string") + var ErrTimestampFormatRequired = errors.New("timestamp format is required") + var ErrTimestampParsingFailed = errors.New("failed to parse time") + var ErrTimestampSourceMissing = errors.New("extracted data did not contain a timestamp") + var ErrTimestampSourceRequired = errors.New("timestamp source value is required if timestamp is specified") + var ErrUnknownMatchAction = errors.New("match stage action should be 'keep' or 'drop'") + var Inspect = false + var MatchActionDrop = "drop" + var MatchActionKeep = "keep" + var TimestampActionOnFailureDefault = TimestampActionOnFailureFudge + var TimestampActionOnFailureFudge = "fudge" + var TimestampActionOnFailureOptions = []string + var TimestampActionOnFailureSkip = "skip" + var Unix = "Unix" + var UnixMs = "UnixMs" + var UnixNs = "UnixNs" + var UnixUs = "UnixUs" + func RunWith(input chan Entry, process func(e Entry) Entry) chan Entry + func RunWithSkip(input chan Entry, process func(e Entry) (Entry, bool)) chan Entry + func RunWithSkipOrSendMany(input chan Entry, process func(e Entry) ([]Entry, bool)) chan Entry + func SanitizeFullLabelName(input string) string + func SetReadLineRateLimiter(rateVal float64, burstVal int, drop bool) + type CRIConfig struct + MaxPartialLineSize uint64 + MaxPartialLineSizeTruncate bool + MaxPartialLines int + func (args *CRIConfig) SetToDefault() + func (args *CRIConfig) Validate() error + type DecolorizeConfig struct + type DockerConfig struct + type DropConfig struct + DropReason string + Expression string + LongerThan units.Base2Bytes + OlderThan time.Duration + Separator string + Source string + Value string + type Entry struct + Extracted map[string]interface{} + type EventLogMessageConfig struct + DropInvalidLabels bool + OverwriteExisting bool + Source string + func (e *EventLogMessageConfig) SetToDefault() + func (e *EventLogMessageConfig) Validate() error + type GenerationalMap struct + func NewGenMap[K comparable, V any](maxSize int, newV func() V, gcCb func()) GenerationalMap[K, V] + func (m *GenerationalMap[K, T]) GetOrCreate(key K) T + type GeoIPConfig struct + CustomLookups map[string]string + DB string + DBType string + Source *string + type GeoIPFields int + const ASN + const ASNORG + const CITYNAME + const CONTINENTCODE + const CONTINENTNAME + const COUNTRYCODE + const COUNTRYNAME + const LOCATION + const POSTALCODE + const SUBDIVISIONCODE + const SUBDIVISIONNAME + const TIMEZONE + type JSONConfig struct + DropMalformed bool + Expressions map[string]string + Source *string + type LabelAllowConfig struct + Values []string + type LabelDropConfig struct + Values []string + type LabelsConfig struct + Values map[string]*string + type LimitConfig struct + Burst int + ByLabelName string + Drop bool + MaxDistinctLabels int + Rate float64 + type LogfmtConfig struct + Mapping map[string]string + Source string + type LuhnFilterConfig struct + MinLength int + Replacement string + Source *string + type MatchConfig struct + Action string + DropReason string + PipelineName string + Selector string + Stages []StageConfig + type MetricConfig struct + Counter *metric.CounterConfig + Gauge *metric.GaugeConfig + Histogram *metric.HistogramConfig + type MetricsConfig struct + Metrics []MetricConfig + type MultilineConfig struct + Expression string + MaxLines uint64 + MaxWaitTime time.Duration + func (args *MultilineConfig) SetToDefault() + func (args *MultilineConfig) Validate() error + type OutputConfig struct + Source string + type PackConfig struct + IngestTimestamp bool + Labels []string + func (p *PackConfig) SetToDefault() + type Packed struct + Entry string + Labels map[string]string + func (w *Packed) UnmarshalJSON(data []byte) error + func (w Packed) MarshalJSON() ([]byte, error) + type Pipeline struct + func NewPipeline(logger log.Logger, stages []StageConfig, jobName *string, ...) (*Pipeline, error) + func (p *Pipeline) Name() string + func (p *Pipeline) Run(in chan Entry) chan Entry + func (p *Pipeline) Size() int + func (p *Pipeline) Wrap(next loki.EntryHandler) loki.EntryHandler + type Processor interface + Name func() string + Process func(labels model.LabelSet, extracted map[string]interface{}, time *time.Time, ...) + type RegexConfig struct + Expression string + Source *string + type ReplaceConfig struct + Expression string + Replace string + Source string + type SamplingConfig struct + DropReason *string + SamplingRate float64 + func (s *SamplingConfig) SetToDefault() + func (s *SamplingConfig) Validate() error + type Stage interface + Name func() string + Run func(chan Entry) chan Entry + func New(logger log.Logger, jobName *string, cfg StageConfig, ...) (Stage, error) + func NewCRI(logger log.Logger, config CRIConfig, registerer prometheus.Registerer) (Stage, error) + func NewDocker(logger log.Logger, registerer prometheus.Registerer) (Stage, error) + type StageConfig struct + CRIConfig *CRIConfig + DecolorizeConfig *DecolorizeConfig + DockerConfig *DockerConfig + DropConfig *DropConfig + EventLogMessageConfig *EventLogMessageConfig + GeoIPConfig *GeoIPConfig + JSONConfig *JSONConfig + LabelAllowConfig *LabelAllowConfig + LabelDropConfig *LabelDropConfig + LabelsConfig *LabelsConfig + LimitConfig *LimitConfig + LogfmtConfig *LogfmtConfig + LuhnFilterConfig *LuhnFilterConfig + MatchConfig *MatchConfig + MetricsConfig *MetricsConfig + MultilineConfig *MultilineConfig + OutputConfig *OutputConfig + PackConfig *PackConfig + RegexConfig *RegexConfig + ReplaceConfig *ReplaceConfig + SamplingConfig *SamplingConfig + StaticLabelsConfig *StaticLabelsConfig + StructuredMetadata *LabelsConfig + TemplateConfig *TemplateConfig + TenantConfig *TenantConfig + TimestampConfig *TimestampConfig + type StaticLabelsConfig struct + Values map[string]*string + type TemplateConfig struct + Source string + Template string + type TenantConfig struct + Label string + Source string + Value string + type TimestampConfig struct + ActionOnFailure string + FallbackFormats []string + Format string + Location *string + Source string