parsers

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: MIT Imports: 3 Imported by: 0

README

Parsers

Go log format parsers, generated by Ldetool producing performant & memory efficient parsers.

Formats

Currently it supports the following formats:

  • AWS Lambda
  • Syslog (rfc5424)
  • Heroku platform messages

GoDoc

Sponsors

Sponsored by my GitHub sponsors:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSLambdaEnd

type AWSLambdaEnd struct {
	Rest      string
	RequestID string
}

AWSLambdaEnd event.

func (*AWSLambdaEnd) Extract

func (p *AWSLambdaEnd) Extract(line string) (bool, error)

Extract ...

type AWSLambdaReport

type AWSLambdaReport struct {
	Rest           string
	RequestID      string
	Duration       float64
	BilledDuration float64
	MemorySize     int
	MaxMemoryUsed  int
}

AWSLambdaReport event.

func (*AWSLambdaReport) Extract

func (p *AWSLambdaReport) Extract(line string) (bool, error)

Extract ...

type AWSLambdaReportInit added in v0.0.2

type AWSLambdaReportInit struct {
	Rest           string
	RequestID      string
	Duration       float64
	BilledDuration float64
	MemorySize     int
	MaxMemoryUsed  int
	InitDuration   float64
}

AWSLambdaReportInit event.

func (*AWSLambdaReportInit) Extract added in v0.0.2

func (p *AWSLambdaReportInit) Extract(line string) (bool, error)

Extract ...

type AWSLambdaStart

type AWSLambdaStart struct {
	Rest      string
	RequestID string
	Version   string
}

AWSLambdaStart event.

func (*AWSLambdaStart) Extract

func (p *AWSLambdaStart) Extract(line string) (bool, error)

Extract ...

type AWSLambdaTimeout added in v1.0.0

type AWSLambdaTimeout struct {
	Rest      string
	Timestamp string
	RequestID string
	Duration  float64
}

AWSLambdaTimeout event.

func (*AWSLambdaTimeout) Extract added in v1.0.0

func (p *AWSLambdaTimeout) Extract(line string) (bool, error)

Extract ...

type Event

type Event interface {
	Extract(line string) (bool, error)
}

Event is the interface used to extract an event from a log line.

func Parse

func Parse(line string) (Event, bool)

Parse a log line from any source. Typically it's best to use a targeted parser such as ParseLambda() or ParseHeroku(). Returns true if an event was successfully parsed.

func ParseHeroku added in v1.1.0

func ParseHeroku(line string) (Event, bool)

ParseHeroku parses a log line from Heroku. You should first parse the syslog line from Heroku using Syslog, and then ParseHeroku() for the platform specific message. Returns true if an event was successfully parsed.

func ParseLambda added in v1.1.0

func ParseLambda(line string) (Event, bool)

ParseLambda parses a log line from AWS Lambda. Returns true if an event was successfully parsed.

type HerokuBuild added in v1.1.0

type HerokuBuild struct {
	Rest string
	User string
}

HerokuBuild event.

func (*HerokuBuild) Extract added in v1.1.0

func (p *HerokuBuild) Extract(line string) (bool, error)

Extract ...

type HerokuConfigRemove added in v1.1.0

type HerokuConfigRemove struct {
	Rest      string
	Variables string
	User      string
}

HerokuConfigRemove event.

func (*HerokuConfigRemove) Extract added in v1.1.0

func (p *HerokuConfigRemove) Extract(line string) (bool, error)

Extract ...

type HerokuConfigSet added in v1.1.0

type HerokuConfigSet struct {
	Rest      string
	Variables string
	User      string
}

HerokuConfigSet event.

func (*HerokuConfigSet) Extract added in v1.1.0

func (p *HerokuConfigSet) Extract(line string) (bool, error)

Extract ...

type HerokuDeploy added in v1.1.0

type HerokuDeploy struct {
	Rest   string
	Commit string
	User   string
}

HerokuDeploy event.

func (*HerokuDeploy) Extract added in v1.1.0

func (p *HerokuDeploy) Extract(line string) (bool, error)

Extract ...

type HerokuProcessExit added in v1.1.0

type HerokuProcessExit struct {
	Rest   string
	Status int
}

HerokuProcessExit event.

func (*HerokuProcessExit) Extract added in v1.1.0

func (p *HerokuProcessExit) Extract(line string) (bool, error)

Extract ...

type HerokuProcessListening added in v1.1.0

type HerokuProcessListening struct {
	Rest string
	Port int
}

HerokuProcessListening event.

func (*HerokuProcessListening) Extract added in v1.1.0

func (p *HerokuProcessListening) Extract(line string) (bool, error)

Extract ...

type HerokuProcessStart added in v1.1.0

type HerokuProcessStart struct {
	Rest    string
	Command string
}

HerokuProcessStart event.

func (*HerokuProcessStart) Extract added in v1.1.0

func (p *HerokuProcessStart) Extract(line string) (bool, error)

Extract ...

type HerokuRelease added in v1.1.0

type HerokuRelease struct {
	Rest    string
	Version string
	User    string
}

HerokuRelease event.

func (*HerokuRelease) Extract added in v1.1.0

func (p *HerokuRelease) Extract(line string) (bool, error)

Extract ...

type HerokuRollback added in v1.1.0

type HerokuRollback struct {
	Rest    string
	Version string
	User    string
}

HerokuRollback event.

func (*HerokuRollback) Extract added in v1.1.0

func (p *HerokuRollback) Extract(line string) (bool, error)

Extract ...

type HerokuScale added in v1.2.0

type HerokuScale struct {
	Rest  string
	Dynos string
	User  string
}

HerokuScale event.

func (*HerokuScale) Extract added in v1.2.0

func (p *HerokuScale) Extract(line string) (bool, error)

Extract ...

type HerokuStateChange added in v1.1.0

type HerokuStateChange struct {
	Rest string
	From string
	To   string
}

HerokuStateChange event.

func (*HerokuStateChange) Extract added in v1.1.0

func (p *HerokuStateChange) Extract(line string) (bool, error)

Extract ...

type Syslog added in v1.1.0

type Syslog struct {
	Rest          string
	Priority      int
	SyslogVersion int
	Timestamp     string
	Hostname      string
	Appname       string
	ProcID        string
	MsgID         string
	Message       string
}

Syslog event.

func (*Syslog) Extract added in v1.1.0

func (p *Syslog) Extract(line string) (bool, error)

Extract ...

Jump to

Keyboard shortcuts

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