Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.
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"`
}
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) GetDedupField ¶
func (LogLine) GetDedupKey ¶
func (*LogLine) TemplateContext ¶
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"`
}
Click to show internal directories.
Click to hide internal directories.