parser

package
v0.0.0-...-9c23c6b Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2017 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logent

type Logent struct {
	Md5       string
	Important int
	// contains filtered or unexported fields
}

Logent defines a single unique log entry. A unique Logent is defined as a tag, a hostname, a priority name or a regexp.

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser handles parsing of regexps to raw syslog messages.

func New

func New(path string) (*Parser, error)

New reads the directory structure pointed to by path for match lists. The name of the file must be the same as the matched syslog tag, eg "cron", "sshd", etc. Each list contains a list of regexes.

func (*Parser) Check

func (p *Parser) Check(tag, msg string) (*Logent, bool)

Check checks for a regex match for tag "tag". Returns Logent for the matched regex and true or false if matched.

func (*Parser) HasTag

func (p *Parser) HasTag(tag string) bool

HasTag checks if a regex match list is available for a given tag.

Jump to

Keyboard shortcuts

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