parse

package
v0.0.0-...-8a6d2ef Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const (
	KeyTime       = "time"
	KeyLevel      = "level"
	KeyMsg        = "msg"
	KeyArgs       = "args"
	KeyThreadName = "thread"
	KeyPathName   = "path"
	KeyLineNo     = "lineno"
	KeyTraceback  = "traceback"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Glob        string            `json:"glob"`
	JsonMapping map[string]string `json:"json_mapping"`
	Regexp      string            `json:"regexp"`
	TimeFormats []string          `json:"time_formats"`
	// For JSON mapping
	// Add key=val to message with all unused key values of json
	AppendArgs bool `json:"append_args"`
}

type Log

type Log struct {
	Msg      string     `json:"msg"`
	Level    string     `json:"level"`
	Time     *time.Time `json:"time,omitempty"`
	FS       string     `json:"fs"`
	FileName string     `json:"file_name"`
	Line     int        `json:"line"`
	Offset   int        `json:"offset"`
	Thread   string     `json:"thread,omitempty"`
	Path     string     `json:"path,omitempty"`
	LineNo   int        `json:"lineno"`
}

type Memory

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

Memory is used to remember which parser applied for a file the same Memory object should be passed to Parse when parsing lines from the same file

type Parse

type Parse []parser

func New

func New(configs []Config) (Parse, error)

func (*Parse) AppendJournal

func (p *Parse) AppendJournal(name string) error

AppendJournal appends a journalctl parser to a parser list

func (Parse) Parse

func (ps Parse) Parse(logName string, line []byte, mem *Memory) *Log

type Type

type Type string

Jump to

Keyboard shortcuts

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