loganalysis

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLogPatterns    = 64
	DefaultMaxSourceCount = 60
	DefaultMaxLoLength    = 300
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyzedLog

type AnalyzedLog struct {
	Parts       []*LAPart      `json:"parts,omitempty"`
	Sample      string         `json:"sample,omitempty"`
	Count       int            `json:"count,omitempty"`
	SourceWords []*SourceWord  `json:"sourceWords,omitempty"`
	Sources     map[string]int `json:"-"`
}

type Analyzer

type Analyzer struct {
	Logs            []*AnalyzedLog
	MaxLogLength    int
	MaxPatternCount int
}

Analyzer This struct needs to be encoded by gob. So all fields are public.

func NewAnalyzer

func NewAnalyzer(maxLogLength, maxPatternCount int) *Analyzer

func (*Analyzer) Analyze

func (a *Analyzer) Analyze(log string)

func (*Analyzer) AnalyzedLogs

func (a *Analyzer) AnalyzedLogs() []*AnalyzedLog

func (*Analyzer) Clear

func (a *Analyzer) Clear()

type Known

type Known struct {
	Patterns []*KnownPatternStat `json:"patterns,omitempty"`
}

type KnownPatternStat

type KnownPatternStat struct {
	Name  string `json:"name"`
	Count int    `json:"count"`
}

type LAPart

type LAPart struct {
	Content string `json:"content"`

	Source    bool `json:"source"`
	Important bool `json:"important"`
	Count     int  `json:"count"`
	// contains filtered or unexported fields
}

type Result

type Result struct {
	// 错误行数
	Count int `json:"count,omitempty"`
	// 错误日志分析
	Unknown *Unknown `json:"unknown,omitempty"`
	// 已知模式匹配数量
	Known *Known `json:"known,omitempty"`
}

type SourceWord

type SourceWord struct {
	Source string `json:"source"`
	Count  int    `json:"count"`
}

type Unknown

type Unknown struct {
	AnalyzedLogs []*AnalyzedLog `json:"analyzedLogs,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL