syslogparser: github.com/leveros/syslogparser Index | Files | Directories

package syslogparser

import "github.com/leveros/syslogparser"

Index

Package Files

syslogparser.go

Constants

const (
    PRI_PART_START = '<'
    PRI_PART_END   = '>'

    NO_VERSION = -1
)

Variables

var (
    ErrEOL     = &ParserError{"End of log line"}
    ErrNoSpace = &ParserError{"No space found"}

    ErrPriorityNoStart  = &ParserError{"No start char found for priority"}
    ErrPriorityEmpty    = &ParserError{"Priority field empty"}
    ErrPriorityNoEnd    = &ParserError{"No end char found for priority"}
    ErrPriorityTooShort = &ParserError{"Priority field too short"}
    ErrPriorityTooLong  = &ParserError{"Priority field too long"}
    ErrPriorityNonDigit = &ParserError{"Non digit found in priority"}

    ErrVersionNotFound = &ParserError{"Can not find version"}

    ErrTimestampUnknownFormat = &ParserError{"Timestamp format unknown"}
)

func FindNextSpace Uses

func FindNextSpace(buff []byte, from int, l int) (int, error)

func IsDigit Uses

func IsDigit(c byte) bool

func Parse2Digits Uses

func Parse2Digits(buff []byte, cursor *int, l int, min int, max int, e error) (int, error)

func ParseHostname Uses

func ParseHostname(buff []byte, cursor *int, l int) (string, error)

func ParseVersion Uses

func ParseVersion(buff []byte, cursor *int, l int) (int, error)

https://tools.ietf.org/html/rfc5424#section-6.2.2

func ShowCursorPos Uses

func ShowCursorPos(buff []byte, cursor int)

type Facility Uses

type Facility struct {
    Value int
}

type LogParser Uses

type LogParser interface {
    Parse() error
    Dump() LogParts
    Location(*time.Location)
}

type LogParts Uses

type LogParts map[string]interface{}

type ParserError Uses

type ParserError struct {
    ErrorString string
}

func (*ParserError) Error Uses

func (err *ParserError) Error() string

type Priority Uses

type Priority struct {
    P   int
    F   Facility
    S   Severity
}

func ParsePriority Uses

func ParsePriority(buff []byte, cursor *int, l int) (Priority, error)

https://tools.ietf.org/html/rfc3164#section-4.1

type Severity Uses

type Severity struct {
    Value int
}

Directories

PathSynopsis
rfc3164
rfc5424

Package syslogparser imports 4 packages (graph) and is imported by 4 packages. Updated 2016-11-06. Refresh now. Tools for package owners.