syslogparser: Index | Files | Directories

package syslogparser

import ""


Package Files



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

    NO_VERSION = -1


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)

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

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)

type Severity Uses

type Severity struct {
    Value int



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