Documentation
¶
Index ¶
- Constants
- func GetLogType(fileName string) string
- func ParseChan(a LogAnalyzer, lines <-chan string, messages chan<- *message.Message) error
- func ParseLines(a LogAnalyzer, lineProvider func() (string, bool, error), ...) error
- func ParseScanner(a LogAnalyzer, scanner *bufio.Scanner, msgConsumer func(*message.Message) bool) error
- func ParseTimeFromFileName(fileName string, delimiter string, pattern string, def time.Time) time.Time
- type AgentLogAnalyzer
- type AgentLogLightAnalyzer
- type HostLogAnalyzer
- type HostLogLightAnalyzer
- type LogAnalyzer
- func GetLogAnalyzer(typeName string, fileName string) LogAnalyzer
- func NewAgentLogAnalyzer(name string) LogAnalyzer
- func NewAgentLogLightAnalyzer(fileName string) LogAnalyzer
- func NewHostLogAnalyzer(fileName string) LogAnalyzer
- func NewHostLogLightAnalyzer(fileName string) LogAnalyzer
- func NewObLogAnalyzer(fileName string) LogAnalyzer
- func NewObLogLightAnalyzer(fileName string) LogAnalyzer
- type LogAnalyzerFactory
- type ObLogAnalyzer
- type ObLogLightAnalyzer
Constants ¶
View Source
const ( // TypeOb 结构化解析 observer 这类日志格式 TypeOb = "ob" // TypeOb 轻量级解析 observer 这类日志格式(仅解析日志中时间戳、日志级别等) TypeObLight = "ob_light" TypeAgent = "agent" TypeAgentLight = "agent_light" TypeHost = "host" TypeHostLight = "host_light" )
Variables ¶
This section is empty.
Functions ¶
func GetLogType ¶
GetLogType 获取日志类型 observer election rootservice obproxy monagent mgragent 等 如传入 election.log.wf 返回
func ParseChan ¶
func ParseChan(a LogAnalyzer, lines <-chan string, messages chan<- *message.Message) error
func ParseLines ¶
func ParseScanner ¶
Types ¶
type AgentLogAnalyzer ¶
type AgentLogAnalyzer struct {
// contains filtered or unexported fields
}
func (*AgentLogAnalyzer) GetFileEndTime ¶
type AgentLogLightAnalyzer ¶
type AgentLogLightAnalyzer struct {
// contains filtered or unexported fields
}
func (*AgentLogLightAnalyzer) GetFileEndTime ¶
GetFileEndTime 获取文件最后写入时间
type HostLogAnalyzer ¶
type HostLogAnalyzer struct {
// contains filtered or unexported fields
}
HostLogAnalyzer 主机日志
func (*HostLogAnalyzer) GetFileEndTime ¶
GetFileEndTime 获取文件最后写入时间
type HostLogLightAnalyzer ¶
type HostLogLightAnalyzer struct {
// contains filtered or unexported fields
}
HostLogAnalyzer 主机日志
func (*HostLogLightAnalyzer) GetFileEndTime ¶
GetFileEndTime 获取文件最后写入时间
type LogAnalyzer ¶
type LogAnalyzer interface { ParseLine(line string) (msg *message.Message, isNewLine bool) GetFileEndTime(logFile os.FileInfo) (time.Time, error) }
func GetLogAnalyzer ¶
func GetLogAnalyzer(typeName string, fileName string) LogAnalyzer
func NewAgentLogAnalyzer ¶
func NewAgentLogAnalyzer(name string) LogAnalyzer
func NewAgentLogLightAnalyzer ¶
func NewAgentLogLightAnalyzer(fileName string) LogAnalyzer
func NewHostLogAnalyzer ¶
func NewHostLogAnalyzer(fileName string) LogAnalyzer
func NewHostLogLightAnalyzer ¶
func NewHostLogLightAnalyzer(fileName string) LogAnalyzer
func NewObLogAnalyzer ¶
func NewObLogAnalyzer(fileName string) LogAnalyzer
func NewObLogLightAnalyzer ¶
func NewObLogLightAnalyzer(fileName string) LogAnalyzer
type LogAnalyzerFactory ¶
type LogAnalyzerFactory func(fileName string) LogAnalyzer
type ObLogAnalyzer ¶
type ObLogAnalyzer struct {
// contains filtered or unexported fields
}
func (*ObLogAnalyzer) GetFileEndTime ¶
type ObLogLightAnalyzer ¶
type ObLogLightAnalyzer struct {
// contains filtered or unexported fields
}
func (*ObLogLightAnalyzer) GetFileEndTime ¶
GetFileEndTime 获取文件最后写入时间 TODO 复用整合
Click to show internal directories.
Click to hide internal directories.