Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Filter ¶
Filter is an interface that performs filtering tasks during log scraping. It allows to ignore log values based on implementation logic.
type FilterFunc ¶
The FilterFunc type is an adapter to allow the use of ordinary functions as scraping filters. If f is a function with the appropriate signature, FilterFunc(f) is a Filter that calls f.
type JSON ¶ added in v0.11.7
type JSON struct { InvalidLogsWriter io.Writer KeyFilter Filter BufferSize uint ScrapUnmarshallableLogs bool // contains filtered or unexported fields }
JSON is a scraper for logs represented as JSON objects.
func (*JSON) StartScraping ¶ added in v0.11.7
func (j *JSON) StartScraping(reader io.Reader) <-chan servicelog.Entry
StartScraping starts scraping logs in JSON format from given reader and sends parsed entries to the returned unbuffered channel. Logs are scraped as long as the passed reader does not return an io.EOF error.
type LogFmt ¶
type LogFmt struct {
KeyFilter Filter
}
LogFmt is a scraper for logs in logfmt format.
See: https://brandur.org/logfmt
func (*LogFmt) StartScraping ¶
func (logFmt *LogFmt) StartScraping(reader io.Reader) <-chan servicelog.Entry
StartScraping starts scraping logs in logfmt format from given reader and sends parsed entries to the returned unbuffered channel. Logs are scraped as long as the passed reader does not return an io.EOF error.
type Scraper ¶
type Scraper interface {
StartScraping(io.Reader) <-chan servicelog.Entry
}
Scraper in an interface for various scrapers that support different log formats.
type ValueFilter ¶
type ValueFilter struct {
Values [][]byte
}
ValueFilter allows to ignore specific values during log scraping.
func (ValueFilter) Match ¶
func (f ValueFilter) Match(v []byte) bool
Match returns true if passed value is on the filtered list - false otherwise.