scogs

package module
v0.0.0-...-fb52d1b Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2016 License: MIT Imports: 7 Imported by: 0

README

scogs

Log Scanners for Go - Logfmt, Cloudfront.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudFrontLogLine

type CloudFrontLogLine struct {
	Comment       bool
	Timestamp     time.Time
	EdgeLocation  string
	ResponseSize  int // in bytes
	Method        string
	Status        int
	CloudFrontURL url.URL
	AccessURL     url.URL
	ResultType    string
	Referer       string
	TimeTaken     float64 // in seconds
	EdgeRequestID string
}

CloudFrontLogLine is the struct representing one line of a CF log.

type CloudFrontLogScanner

type CloudFrontLogScanner struct {
	bufio.Scanner
}

CloudFrontLogScanner extends a bufio.Scanner with CloudFront log reading cababilities.

func NewCloudFrontScanner

func NewCloudFrontScanner(r io.Reader) CloudFrontLogScanner

NewCloudFrontScanner creates a new CloudFront log scanner with a Reader. The reader must point to an uncompressed CloudFront log.

func (*CloudFrontLogScanner) LogLine

LogLine parses the current scanner's Text() into a CF log line. See http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html#BasicDistributionFileFormat for information about fields.

type LogfmtKV

type LogfmtKV map[string]string

LogfmtKV is a string to string map that represents a single logfmt log line.

type LogfmtScanner

type LogfmtScanner struct {
	bufio.Scanner
}

LogfmtScanner extends a bufio.Scanner to make it capable of parsing Logfmt formatted logs.

func NewLogfmtScanner

func NewLogfmtScanner(r io.Reader) LogfmtScanner

NewLogfmtScanner creates a new logfmt scanner from the given reader. Assumes the stream is uncompressed.

func (*LogfmtScanner) LogLineKV

func (s *LogfmtScanner) LogLineKV() LogfmtKV

LogLineKV reads the current logfmt log line into a LogfmtKV

Jump to

Keyboard shortcuts

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