Documentation
¶
Index ¶
- func ByExcluding(predicate func(*core.LogEvent) bool) core.LogEventFilter
- func ByIncluding(predicate func(*core.LogEvent) bool) core.LogEventFilter
- func MatchAllProperties(matchers ...core.LogEventFilter) core.LogEventFilter
- func MatchAnyProperty(matchers ...core.LogEventFilter) core.LogEventFilter
- func MatchProperty(propertyName string, expectedValue interface{}) core.LogEventFilter
- func MatchPropertyAbsent(propertyName string) core.LogEventFilter
- func MatchPropertyContains(propertyName string, substring string) core.LogEventFilter
- func MatchPropertyExists(propertyName string) core.LogEventFilter
- func MatchPropertyRegex(propertyName string, pattern string) core.LogEventFilter
- func MinimumLevelFilter(level core.LogEventLevel) core.LogEventFilter
- func When(condition bool, filter core.LogEventFilter) core.LogEventFilter
- type CompositeFilter
- type ExpressionFilter
- type HashSamplingFilter
- type LevelFilter
- type NotFilter
- type OrFilter
- type PredicateFilter
- type RateLimitFilter
- type SamplingFilter
- type SourceContextLevelFilter
- func (f *SourceContextLevelFilter) AddOverride(sourceContext string, level core.LogEventLevel)
- func (f *SourceContextLevelFilter) IsEnabled(event *core.LogEvent) bool
- func (f *SourceContextLevelFilter) RemoveOverride(sourceContext string)
- func (f *SourceContextLevelFilter) SetDefaultLevel(level core.LogEventLevel)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByExcluding ¶
func ByExcluding(predicate func(*core.LogEvent) bool) core.LogEventFilter
ByExcluding creates a filter that excludes events matching the predicate.
func ByIncluding ¶
func ByIncluding(predicate func(*core.LogEvent) bool) core.LogEventFilter
ByIncluding creates a filter that includes only events matching the predicate.
func MatchAllProperties ¶
func MatchAllProperties(matchers ...core.LogEventFilter) core.LogEventFilter
MatchAllProperties creates a filter that matches when all properties match.
func MatchAnyProperty ¶
func MatchAnyProperty(matchers ...core.LogEventFilter) core.LogEventFilter
MatchAnyProperty creates a filter that matches when any of the properties match.
func MatchProperty ¶
func MatchProperty(propertyName string, expectedValue interface{}) core.LogEventFilter
MatchProperty creates a filter that matches when a property equals a specific value.
func MatchPropertyAbsent ¶
func MatchPropertyAbsent(propertyName string) core.LogEventFilter
MatchPropertyAbsent creates a filter that matches when a property does not exist.
func MatchPropertyContains ¶
func MatchPropertyContains(propertyName string, substring string) core.LogEventFilter
MatchPropertyContains creates a filter that matches when a property contains a substring.
func MatchPropertyExists ¶
func MatchPropertyExists(propertyName string) core.LogEventFilter
MatchPropertyExists creates a filter that matches when a property exists.
func MatchPropertyRegex ¶
func MatchPropertyRegex(propertyName string, pattern string) core.LogEventFilter
MatchPropertyRegex creates a filter that matches when a property matches a regex pattern.
func MinimumLevelFilter ¶
func MinimumLevelFilter(level core.LogEventLevel) core.LogEventFilter
MinimumLevelFilter is a convenience function that creates a level filter.
func When ¶
func When(condition bool, filter core.LogEventFilter) core.LogEventFilter
When creates a conditional filter that applies when the condition is true.
Types ¶
type CompositeFilter ¶
type CompositeFilter struct {
// contains filtered or unexported fields
}
CompositeFilter combines multiple filters with AND logic.
func NewCompositeFilter ¶
func NewCompositeFilter(filters ...core.LogEventFilter) *CompositeFilter
NewCompositeFilter creates a filter that requires all sub-filters to pass.
func (*CompositeFilter) Add ¶
func (f *CompositeFilter) Add(filter core.LogEventFilter)
Add adds a new filter to the composite.
type ExpressionFilter ¶
type ExpressionFilter struct {
// contains filtered or unexported fields
}
ExpressionFilter filters log events based on property values.
func NewExpressionFilter ¶
func NewExpressionFilter(propertyName string, matcher func(interface{}) bool) *ExpressionFilter
NewExpressionFilter creates a filter that matches based on a property value.
type HashSamplingFilter ¶
type HashSamplingFilter struct {
// contains filtered or unexported fields
}
HashSamplingFilter samples events based on a hash of a property value. This ensures consistent sampling for the same property values.
func NewHashSamplingFilter ¶
func NewHashSamplingFilter(propertyName string, rate float32) *HashSamplingFilter
NewHashSamplingFilter creates a filter that samples based on property value hash.
type LevelFilter ¶
type LevelFilter struct {
// contains filtered or unexported fields
}
LevelFilter filters log events based on their level.
func NewLevelFilter ¶
func NewLevelFilter(minimumLevel core.LogEventLevel) *LevelFilter
NewLevelFilter creates a filter that only allows events at or above the specified level.
type NotFilter ¶
type NotFilter struct {
// contains filtered or unexported fields
}
NotFilter inverts the result of another filter.
func NewNotFilter ¶
func NewNotFilter(inner core.LogEventFilter) *NotFilter
NewNotFilter creates a filter that inverts another filter's result.
type OrFilter ¶
type OrFilter struct {
// contains filtered or unexported fields
}
OrFilter combines multiple filters with OR logic.
func NewOrFilter ¶
func NewOrFilter(filters ...core.LogEventFilter) *OrFilter
NewOrFilter creates a filter that passes if any sub-filter passes.
type PredicateFilter ¶
type PredicateFilter struct {
// contains filtered or unexported fields
}
PredicateFilter filters log events based on a custom predicate function.
func NewPredicateFilter ¶
func NewPredicateFilter(predicate func(*core.LogEvent) bool) *PredicateFilter
NewPredicateFilter creates a filter that uses a custom predicate function.
type RateLimitFilter ¶
type RateLimitFilter struct {
// contains filtered or unexported fields
}
RateLimitFilter limits the number of events per time window.
func NewRateLimitFilter ¶
func NewRateLimitFilter(maxEvents int, windowNanos int64) *RateLimitFilter
NewRateLimitFilter creates a filter that limits events to maxEvents per window.
type SamplingFilter ¶
type SamplingFilter struct {
// contains filtered or unexported fields
}
SamplingFilter filters log events based on sampling rules.
func NewSamplingFilter ¶
func NewSamplingFilter(rate float32) *SamplingFilter
NewSamplingFilter creates a filter that samples events at the specified rate. Rate should be between 0.0 (no events) and 1.0 (all events).
type SourceContextLevelFilter ¶
type SourceContextLevelFilter struct {
// contains filtered or unexported fields
}
SourceContextLevelFilter filters log events based on source context and minimum level.
func NewSourceContextLevelFilter ¶
func NewSourceContextLevelFilter(defaultLevel core.LogEventLevel, overrides map[string]core.LogEventLevel) *SourceContextLevelFilter
NewSourceContextLevelFilter creates a new filter with source context level overrides.
func (*SourceContextLevelFilter) AddOverride ¶
func (f *SourceContextLevelFilter) AddOverride(sourceContext string, level core.LogEventLevel)
AddOverride adds or updates a source context level override.
func (*SourceContextLevelFilter) IsEnabled ¶
func (f *SourceContextLevelFilter) IsEnabled(event *core.LogEvent) bool
IsEnabled determines if a log event should be processed based on its source context and level.
func (*SourceContextLevelFilter) RemoveOverride ¶
func (f *SourceContextLevelFilter) RemoveOverride(sourceContext string)
RemoveOverride removes a source context level override.
func (*SourceContextLevelFilter) SetDefaultLevel ¶
func (f *SourceContextLevelFilter) SetDefaultLevel(level core.LogEventLevel)
SetDefaultLevel updates the default minimum level.