loggly

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: 11 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)

Types

type Event

type Event struct {
	Timestamp uint   `json:"timestamp"`
	Logmsg    string `json:"logmsg"`
}

func NewEvents

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

type EventsOptions

type EventsOptions struct {
	RSID    string `url:"rsid"`
	Page    uint   `url:"page,omitempty"`
	Format  string `url:"format,omitempty"`
	Columns string `url:"columns,omitempty"`
}

type EventsResponse

type EventsResponse struct {
	TotalEvents uint     `json:"total_events"`
	Page        uint     `json:"page"`
	Events      []*Event `json:"events"`
}

type Logger

type Logger struct {
	*client.Client
}

func NewLogger

func NewLogger(token string) *Logger

func (*Logger) Close

func (l *Logger) Close() error

func (*Logger) Format

func (l *Logger) Format(m *cypress.Message) ([]byte, error)

func (*Logger) Receive

func (l *Logger) Receive(message *cypress.Message) error

type LogglyRecv

type LogglyRecv struct {
	*http.Client
	Username      string
	Password      string
	RSIDRootURL   string
	EventsRootURL string
	RSIDOptions   *RSIDOptions
	EventsOptions *EventsOptions
	EventBuffer   chan *Event
}

func NewLogglyRecv

func NewLogglyRecv(account, username, password string, ro *RSIDOptions, eo *EventsOptions, bufferSize int) (*LogglyRecv, error)

func (*LogglyRecv) BufferEvents

func (lr *LogglyRecv) BufferEvents(events []*Event) error

func (*LogglyRecv) Close

func (lr *LogglyRecv) Close() error

func (*LogglyRecv) EncodeEventsURL

func (lr *LogglyRecv) EncodeEventsURL(o *EventsOptions) string

func (*LogglyRecv) EncodeRSIDURL

func (lr *LogglyRecv) EncodeRSIDURL(o *RSIDOptions) string

func (*LogglyRecv) Generate

func (lr *LogglyRecv) Generate() (*cypress.Message, error)

func (*LogglyRecv) GetBody

func (lr *LogglyRecv) GetBody(url string) ([]byte, error)

func (*LogglyRecv) Search

func (lr *LogglyRecv) Search(ro *RSIDOptions, eo *EventsOptions) ([]*Event, error)

func (*LogglyRecv) SearchEvents

func (lr *LogglyRecv) SearchEvents(o *EventsOptions) ([]*Event, error)

func (*LogglyRecv) SearchRSID

func (lr *LogglyRecv) SearchRSID(o *RSIDOptions) (*RSIDResponse, error)

func (*LogglyRecv) SetDefaultEventsOptions

func (lr *LogglyRecv) SetDefaultEventsOptions(o *EventsOptions) *EventsOptions

func (*LogglyRecv) SetDefaultRSIDOptions

func (lr *LogglyRecv) SetDefaultRSIDOptions(o *RSIDOptions) *RSIDOptions

type Plugin

type Plugin struct {
	Token string

	Account  string
	Username string
	Password string

	Q     string
	From  string
	Until string
	Order string
	Size  uint

	BufferSize int
}

func (*Plugin) Generator

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

func (*Plugin) Receiver

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

type RSID

type RSID struct {
	Status      string  `json:"status"`
	DateFrom    uint    `json:"date_from"`
	ElapsedTime float64 `json:"elapsed_time"`
	DateTo      uint    `json:"date_to"`
	ID          string  `json:"id"`
}

type RSIDOptions

type RSIDOptions struct {
	Q     string `url:"q,omitempty"`
	From  string `url:"from,omitempty"`
	Until string `url:"until,omitempty"`
	Order string `url:"order,omitempty"`
	Size  uint   `url:"size,omitempty"`
}

type RSIDResponse

type RSIDResponse struct {
	RSID `json:"rsid"`
}

func NewRSID

func NewRSID(body []byte) (*RSIDResponse, error)

type Recv

type Recv struct {
	Account  string `short:"a" long:"account" description:"Loggly account name"`
	Username string `short:"u" long:"username" description:"Loggly username"`
	Password string `short:"p" long:"password" description:"Loggly password"`

	Q     string `short:"q" long:"query" description:"Loggly search query"`
	From  string `long:"from" default:"-24h" description:"Start time for the search."`
	Until string `long:"until" default:"now" description:"End time for the search."`
	Order string `long:"order" default:"desc" description:"Direction of results returned, either asc or desc."`
	Size  uint   `long:"size" default:"100" description:"Number of rows returned by search."`

	BufferSize int `long:"buffersize" default:"100"`
}

func (*Recv) Execute

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

type Send

type Send struct {
	Token string `short:"T" long:"token" description:"Loggly token that uniquely identifies the destination log"`
}

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