Documentation
¶
Index ¶
- Variables
- func DetectFormat(msg string) string
- func GroupLogs(result *LogResult, config FieldMappingConfig)
- func MapFieldToLogLine(key string, value any, line *LogLine, config FieldMappingConfig) error
- func ParseAutodetect(line *LogLine)
- func ParseJSON(line *LogLine)
- func ParseKlogfmt(line *LogLine)
- func ParseLogfmt(line *LogLine)
- func ParseMessage(line *LogLine, format string)
- func ParseSyslog(line *LogLine)
- type FieldMappingConfig
- type LogGroup
- type LogLine
- func (t LogLine) EffectiveMessage(messageFields ...string) string
- func (t LogLine) GetFieldKey(fields []string, messageFields ...string) string
- func (t LogLine) GetFieldValue(field string, messageFields ...string) string
- func (t *LogLine) SetHash()
- func (t *LogLine) TemplateContext(messageFields ...string) map[string]any
- type LogResult
- type LogsRequestBase
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultMessageFields = []string{"msg", "message"}
Functions ¶
func DetectFormat ¶ added in v1.0.1223
func GroupLogs ¶ added in v1.0.1223
func GroupLogs(result *LogResult, config FieldMappingConfig)
func MapFieldToLogLine ¶
func MapFieldToLogLine(key string, value any, line *LogLine, config FieldMappingConfig) error
MapFieldToLogLine maps a given key-value pair to the appropriate field in the LogLine struct based on the provided FieldMappingConfig.
func ParseAutodetect ¶ added in v1.0.1223
func ParseAutodetect(line *LogLine)
func ParseKlogfmt ¶ added in v1.0.1223
func ParseKlogfmt(line *LogLine)
func ParseLogfmt ¶ added in v1.0.1223
func ParseLogfmt(line *LogLine)
func ParseMessage ¶ added in v1.0.1223
func ParseSyslog ¶ added in v1.0.1223
func ParseSyslog(line *LogLine)
Types ¶
type FieldMappingConfig ¶
type FieldMappingConfig struct {
ID []string `json:"id,omitempty" yaml:"id,omitempty"`
Message []string `json:"message,omitempty" yaml:"message,omitempty"`
Timestamp []string `json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
Host []string `json:"host,omitempty" yaml:"host,omitempty"`
Severity []string `json:"severity,omitempty" yaml:"severity,omitempty"`
Source []string `json:"source,omitempty" yaml:"source,omitempty"`
Ignore []string `json:"ignore,omitempty" yaml:"ignore,omitempty"`
GroupBy []string `json:"groupBy,omitempty" yaml:"groupBy,omitempty"`
DedupBy []string `json:"dedupBy,omitempty" yaml:"dedupBy,omitempty"`
}
FieldMappingConfig defines how source log fields map to canonical LogLine fields. Each key represents a canonical field (e.g., "message", "timestamp"), and the value is a list of possible source field names.
+kubebuilder:object:generate=true
func (*FieldMappingConfig) DeepCopy ¶
func (in *FieldMappingConfig) DeepCopy() *FieldMappingConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FieldMappingConfig.
func (*FieldMappingConfig) DeepCopyInto ¶
func (in *FieldMappingConfig) DeepCopyInto(out *FieldMappingConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (FieldMappingConfig) Empty ¶
func (c FieldMappingConfig) Empty() bool
func (FieldMappingConfig) WithDefaults ¶
func (c FieldMappingConfig) WithDefaults(defaultMap FieldMappingConfig) FieldMappingConfig
type LogLine ¶
type LogLine struct {
ID string `json:"id,omitempty"`
FirstObserved time.Time `json:"firstObserved,omitempty"`
LastObserved *time.Time `json:"lastObserved,omitempty"`
Count int `json:"count,omitempty"`
Message string `json:"message"`
Hash string `json:"hash,omitempty"`
Severity string `json:"severity,omitempty"`
Source string `json:"source,omitempty"`
Host string `json:"host,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
}
func (LogLine) EffectiveMessage ¶ added in v1.0.1223
func (LogLine) GetFieldKey ¶ added in v1.0.1223
func (LogLine) GetFieldValue ¶ added in v1.0.1223
type LogsRequestBase ¶
type LogsRequestBase struct {
// The start time for the query
// SupportsDatemath
Start string `json:"start,omitempty"`
// The end time for the query
// Supports Datemath
End string `json:"end,omitempty"`
// Limit is the maximum number of lines to return
Limit string `json:"limit,omitempty" template:"true"`
}
Directories
¶
| Path | Synopsis |
|---|---|
|
ABOUTME: Implements log searching against Azure Monitor Log Analytics workspaces.
|
ABOUTME: Implements log searching against Azure Monitor Log Analytics workspaces. |
Click to show internal directories.
Click to hide internal directories.