logging

package
v0.0.0-...-3ee71c1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2014 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogsExchange = "syslog"
	DefaultTtl   = int32(60000)
)
View Source
const (
	DEFAULT_LOG_ROOT = "/var/log/hourly"
	HOURLY_PATTERN   = "2006/01/02/2006-01-02T15.log"
)

Variables

View Source
var TagRegexp = regexp.MustCompile("(.*?)\\[(\\d*)\\]")
View Source
var UUIDRegexp = regexp.MustCompile("([a-z0-9\\-]{36})")

Functions

This section is empty.

Types

type ElasticSearchIndexMapping

type ElasticSearchIndexMapping map[string]map[string]map[string]es.DynamicTemplates

type HAProxyLine

type HAProxyLine struct {
	SyslogLine
	Frontend            string
	Backend             string
	BackendHost         string
	BackendImageId      string
	BackendContainerId  string
	Status              string
	Length              int
	ClientRequestTime   int
	ConnectionQueueTime int
	TcpConnectTime      int
	ServerResponseTime  int
	SessionDurationTime int
	ActiveConnections   int
	FrontendConnections int
	BackendConnectons   int
	ServerConnections   int
	Retries             int
	ServerQueue         int
	BackendQueue        int
	Method              string
	Uri                 string
}

func (*HAProxyLine) Parse

func (line *HAProxyLine) Parse(raw string) error

type Indexer

type Indexer struct {
	AMQPAddress        string
	ElasticSearchHost  string
	ElasticSearchIndex string
	ElasticSearchType  string
	QueueName          string
	BatchSize          int
	Ttl                int32
	Debug              bool
}

func (*Indexer) CreateMappingWhenNotExists

func (indexer *Indexer) CreateMappingWhenNotExists(esIndex *es.Index) error

func (*Indexer) IndexMapping

func (indexer *Indexer) IndexMapping(indexName string) ElasticSearchIndexMapping

func (*Indexer) NewEsIndex

func (indexer *Indexer) NewEsIndex() *es.Index

func (*Indexer) Run

func (indexer *Indexer) Run()

func (*Indexer) RunWithoutReconnect

func (indexer *Indexer) RunWithoutReconnect() error

type NginxLine

type NginxLine struct {
	*SyslogLine
	Method        string
	Status        string
	Length        int
	TotalTime     float64
	UnicornTime   float64
	HttpHost      string
	UserAgentName string
	Uri           string
	Referer       string
}

func (*NginxLine) Parse

func (line *NginxLine) Parse(raw string) error

type Parser

type Parser interface {
	Parse(string) error
}

type RabbitFeeder

type RabbitFeeder struct {
	Address  string // <host>:<port>
	Exchange string
	Ttl      int32
	*amqp.Channel
}

func (*RabbitFeeder) Connection

func (feeder *RabbitFeeder) Connection() (con *amqp.Connection, e error)

func (*RabbitFeeder) Feed

func (feeder *RabbitFeeder) Feed(in io.Reader) error

type RemoteLog

type RemoteLog struct {
	Host          string
	Pattern       string
	Tail          bool
	Time          time.Time
	Compress      bool
	CustomLogRoot string
}

func NewRemoteLogFromTime

func NewRemoteLogFromTime(host string, t time.Time, pattern string) *RemoteLog

func (*RemoteLog) CatCmd

func (rl *RemoteLog) CatCmd() string

func (*RemoteLog) Command

func (rl *RemoteLog) Command() string

func (*RemoteLog) Current

func (rl *RemoteLog) Current() string

func (*RemoteLog) GrepCmd

func (rl *RemoteLog) GrepCmd() string

func (*RemoteLog) GzipPath

func (rl *RemoteLog) GzipPath() string

func (*RemoteLog) LogRoot

func (rl *RemoteLog) LogRoot() string

func (*RemoteLog) Path

func (rl *RemoteLog) Path() string

func (*RemoteLog) Reader

func (rl *RemoteLog) Reader() (reader io.ReadCloser, e error)

type SyslogLine

type SyslogLine struct {
	Raw      string
	Time     time.Time
	Host     string
	Tag      string
	Severity string
	Pid      int
	// contains filtered or unexported fields
}

func (*SyslogLine) Parse

func (line *SyslogLine) Parse(raw string) (e error)

func (*SyslogLine) Tags

func (line *SyslogLine) Tags() (t map[string]interface{})

type UnicornLine

type UnicornLine struct {
	UUID string
	SyslogLine
}

func (*UnicornLine) Parse

func (line *UnicornLine) Parse(raw string) error

Jump to

Keyboard shortcuts

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