rfc3164

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

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

Go to latest
Published: Jun 22, 2015 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

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

func NewParser

func NewParser(buff *[]byte) *Parser
Example
package main

import (
	"fmt"
	"github.com/scalingdata/syslogparser/rfc3164"
)

func main() {
	b := "<34>Oct 11 22:14:15 mymachine su: 'su root' failed for lonvick on /dev/pts/8"
	buff := []byte(b)

	p := rfc3164.NewParser(&buff)
	err := p.Parse()
	if err != nil {
		panic(err)
	}

	fmt.Println(p.Dump())
}
Output:

func (*Parser) Dump

func (p *Parser) Dump() syslogparser.LogParts

func (*Parser) Message

func (p *Parser) Message() message.IMessage

func (*Parser) Parse

func (p *Parser) Parse() error

type Rfc3164Message

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

func (Rfc3164Message) Facility

func (self Rfc3164Message) Facility() message.Facility

func (Rfc3164Message) Hostname

func (self Rfc3164Message) Hostname() string

func (Rfc3164Message) Message

func (self Rfc3164Message) Message() string

func (Rfc3164Message) Pid

func (self Rfc3164Message) Pid() string

func (Rfc3164Message) Process

func (self Rfc3164Message) Process() string

func (Rfc3164Message) RawMessage

func (self Rfc3164Message) RawMessage() *[]byte

func (Rfc3164Message) Severity

func (self Rfc3164Message) Severity() message.Severity

func (Rfc3164Message) TimeStamp

func (self Rfc3164Message) TimeStamp() time.Time

type TimeNow

type TimeNow func() time.Time

Jump to

Keyboard shortcuts

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