Documentation ¶
Index ¶
- func DrainCSV(join string) func(<-chan LogLine, io.WriteCloser)
- func DrainCountOverTime(key string) func(<-chan LogLine, io.WriteCloser)
- func DrainGnuplotDistinctKeyCount(key string) func(<-chan LogLine, io.WriteCloser)
- func DrainSqlite3() func(<-chan LogLine, io.WriteCloser)
- func DrainStandard() func(<-chan LogLine, io.WriteCloser)
- func FilterLogChan(filters []Filterer, in <-chan LogLine, out chan<- LogLine)
- func Fuzz(data []byte) int
- func MakeBucketizeKey(key string) func(*LogLine) *LogLine
- func MakeCompondKey(newKey string, sourceKeys []string) func(*LogLine) *LogLine
- func MakeLuaFilter(prog string) func(*LogLine) *LogLine
- func MakeNormaliseUrlPaths(key string, urlTemplates []string) func(*LogLine) *LogLine
- func MakePickFilter(keys []string) func(*LogLine) *LogLine
- func MakeRemoveHerokuDrainId() func(*LogLine) *LogLine
- func MakeRoundTimestampFilter(d time.Duration) func(*LogLine) *LogLine
- func ParseLogEntries(in <-chan string, out chan<- LogLine)
- type Drainer
- type Filterer
- type LogLine
- func (l LogLine) Equal(other LogLine) bool
- func (l *LogLine) GetNumber(key string) float64
- func (l *LogLine) HandleLogfmt(key, val []byte) error
- func (l *LogLine) HasKey(key string) bool
- func (l *LogLine) HasPrefix(prefix string) bool
- func (l LogLine) MarshalJSON() ([]byte, error)
- func (l *LogLine) SetNumber(key string, val float64)
- func (l *LogLine) String() string
- type Query
- type QueryGroup
- type Source
- type SourceLoader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DrainCountOverTime ¶
func DrainCountOverTime(key string) func(<-chan LogLine, io.WriteCloser)
func DrainGnuplotDistinctKeyCount ¶
func DrainGnuplotDistinctKeyCount(key string) func(<-chan LogLine, io.WriteCloser)
func DrainSqlite3 ¶
func DrainSqlite3() func(<-chan LogLine, io.WriteCloser)
func DrainStandard ¶
func DrainStandard() func(<-chan LogLine, io.WriteCloser)
func FilterLogChan ¶
Run the LogLines on `in` through the given filters and put them on `out`. Note: Closes `out` when `in` does so.
func MakeBucketizeKey ¶
Creates a filter that will bucketize the named key.
Numbers are basically rounded to their nearest value per their order or magnitude; i.e. numbers in the hundredes, will be rounded down to nearest hundred, numbers in the tousands will be rounded down towards nearest thousand.
Note: Round down here actually meands "towards zero"
func MakeCompondKey ¶
Make a new key, `newKey`, based on a concatenation of `sourceKeys`.
func MakeLuaFilter ¶
func MakeNormaliseUrlPaths ¶
Normalise paths from a given URL after given express-style templates.
Ex `path=/users/msiebuhr/add` w. template `/users/:uid/add` will normalize to `path=/users/:uid/add uid=msiebuhr`.
func MakePickFilter ¶
Creates a filter that keeps only the given keys for each log-line
func MakeRemoveHerokuDrainId ¶
Make a new key, `newKey`, based on a concatenation of `sourceKeys`.
func MakeRoundTimestampFilter ¶
Creates a filter that rounds the LogEntries time to the given duration
func ParseLogEntries ¶
Types ¶
type Drainer ¶
type Drainer func(<-chan LogLine, io.WriteCloser)
type LogLine ¶
func (*LogLine) HandleLogfmt ¶
Implements interface from "github.com/kr/logfmt"
func (LogLine) MarshalJSON ¶
type Query ¶
type Query struct { // A prefix to group things by Filter string // When the log start and end Start time.Time End time.Time // How many lines to fetch Limit int GroupBy []QueryGroup }
func FileSource ¶
Get data from a file
type QueryGroup ¶
QueryGroup
func NewQueryGroup ¶
func NewQueryGroup(name string, keys []string) QueryGroup
func (*QueryGroup) Group ¶
func (q *QueryGroup) Group(l *LogLine)
Create a new key in l by name and composed of the given keys.
type SourceLoader ¶
Keep a map of protocols -> default settings, all parsed from URLs
func (*SourceLoader) TryLoadConfigs ¶
func (s *SourceLoader) TryLoadConfigs(filenames []string) error