papertrail

package
v0.0.0-...-c2832fb Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2016 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCypressMessage

func NewCypressMessage(event *Event) (*cypress.Message, error)

func NewLogger

func NewLogger(address string, ssl bool) *tcplog.Logger

Types

type Event

type Event struct {
	Id                string `json:"id'`
	ReceivedAt        string `json:"received_at"`
	DisplayReceivedAt string `json:"display_received_at"`
	SourceName        string `json:"source_name"`
	SourceId          uint32 `json:"source_id"`
	SourceIp          string `json:"source_ip"`
	Facility          string `json:"facility"`
	Severity          string `json:"severity"`
	Program           string `json:"program"`
	Message           string `json:"message"`
}

func NewEvents

func NewEvents(body []byte) ([]*Event, error)

type EventsOptions

type EventsOptions struct {
	Q        string `url:"q,omitempty"`
	GroupId  string `url:"group_id,omitempty"`
	SystemId string `url:"system_id,omitempty"`
	MinId    string `url:"min_id,omitempty"`
	MaxId    string `url:"max_id,omitempty"`
	MinTime  string `url:"min_time,omitempty"`
	MaxTime  string `url:"max_time,omitempty"`
	Tail     bool   `url:"tail,omitempty"`
}

type EventsResponse

type EventsResponse struct {
	Events           []*Event `json:"events"`
	MinId            string   `json:"min_id"`
	MaxId            string   `json:"max_id"`
	ReachedBeginning bool     `json:"reached_beginning"`
	ReachedTimeLimit bool     `json:"reached_time_limit"`
}

type PapertrailFormatter

type PapertrailFormatter struct{}

func (*PapertrailFormatter) Format

func (pf *PapertrailFormatter) Format(m *cypress.Message) ([]byte, error)

type PapertrailRecv

type PapertrailRecv struct {
	*http.Client
	Token       string
	Options     *EventsOptions
	EventBuffer chan *Event
}

func NewPapertrailRecv

func NewPapertrailRecv(token string, options *EventsOptions, bufferSize int) *PapertrailRecv

func (*PapertrailRecv) BufferEvents

func (pr *PapertrailRecv) BufferEvents(events []*Event) error

func (*PapertrailRecv) Close

func (pr *PapertrailRecv) Close() error

func (*PapertrailRecv) EncodeURL

func (pr *PapertrailRecv) EncodeURL(o *EventsOptions) string

func (*PapertrailRecv) Generate

func (pr *PapertrailRecv) Generate() (*cypress.Message, error)

func (*PapertrailRecv) GetBody

func (pr *PapertrailRecv) GetBody(url string) ([]byte, error)

func (*PapertrailRecv) Search

func (pr *PapertrailRecv) Search(o *EventsOptions) ([]*Event, error)

func (*PapertrailRecv) SetDefaultOptions

func (pr *PapertrailRecv) SetDefaultOptions(o *EventsOptions) *EventsOptions

type Plugin

type Plugin struct {
	Host string
	Ssl  bool

	Token    string
	Q        string
	GroupId  string
	SystemId string
	MinId    string
	MaxId    string
	MinTime  string
	MaxTime  string

	Tail       bool
	BufferSize int
}

func (*Plugin) Generator

func (p *Plugin) Generator() (cypress.Generator, error)

func (*Plugin) Receiver

func (p *Plugin) Receiver() (cypress.Receiver, error)

type Recv

type Recv struct {
	Token      string `short:"T" long:"token" description:"Papertrail token"`
	Q          string `short:"q" long:"query" description:"Papertrail search query"`
	GroupId    string `long:"groupid" description:"Limit results to specific Papertrail group"`
	SystemId   string `long:"systemid" description:"Limit results to specific Papertrail system"`
	MinId      string `long:"minid" description:"The oldest Papertrail message ID to examine"`
	MaxId      string `long:"maxid" description:"The newest Papertrail message ID to examine"`
	MinTime    string `long:"mintime" description:"The oldest Papertrail timestamp to examine"`
	MaxTime    string `long:"maxtime" description:"The newest Papertrail timestamp to examine"`
	Tail       bool   `long:"tail" default:"false" description:"Set to true to search newest to oldest"`
	BufferSize int    `long:"buffersize" default:"100"`
}

func (*Recv) Execute

func (g *Recv) Execute(args []string) error

type Send

type Send struct {
	Host string `short:"H" long:"host" description:"Papertrail host <host>:<port>"`
	Ssl  bool   `short:"S" long:"tls" default:"false" description:"Use TLS"`
}

func (*Send) Execute

func (p *Send) Execute(args []string) error

Jump to

Keyboard shortcuts

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