{"modulePath":"github.com/AliyunContainerService/node-problem-detector","version":"v0.6.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package systemlogmonitor\n\n## Functions\n\n```go\nfunc NewLogBuffer(maxLines int) *logBuffer\n```\nNewLogBuffer creates log buffer with max line number limit. Because we only match logs in the log buffer, the max buffer line number is also the max pattern line number we support. Smaller buffer line number means less memory and cpu usage, but also means less lines of patterns we support.\n\n```go\nfunc NewLogMonitorOrDie(configPath string) types.Monitor\n```\nNewLogMonitorOrDie create a new LogMonitor, panic if error occurs.\n\n## Types\n\n```go\ntype LogBuffer interface {\n\t// Push pushes log into the log buffer.\n\tPush(*types.Log)\n\t// Match with regular expression in the log buffer.\n\tMatch(string) []*types.Log\n\t// String returns a concatenated string of the buffered logs.\n\tString() string\n}\n```\nLogBuffer buffers the logs and supports match in the log buffer with regular expression.\n\n```go\ntype MonitorConfig struct {\n\t// WatcherConfig is the configuration of log watcher.\n\twatchertypes.WatcherConfig\n\t// BufferSize is the size (in lines) of the log buffer.\n\tBufferSize int `json:\"bufferSize\"`\n\t// Source is the source name of the log monitor\n\tSource string `json:\"source\"`\n\t// DefaultConditions are the default states of all the conditions log monitor should handle.\n\tDefaultConditions []types.Condition `json:\"conditions\"`\n\t// Rules are the rules log monitor will follow to parse the log file.\n\tRules []systemlogtypes.Rule `json:\"rules\"`\n}\n```\nMonitorConfig is the configuration of log monitor.\n\n```go\nfunc (mc *MonitorConfig) ApplyDefaultConfiguration()\n```\nApplyConfiguration applies default configurations.\n\n```go\nfunc (mc MonitorConfig) ValidateRules() error\n```\nValidateRules verifies whether the regular expressions in the rules are valid.\n\n","path":"github.com/AliyunContainerService/node-problem-detector/pkg/systemlogmonitor","name":"systemlogmonitor","synopsis":"","isRedistributable":true}
