Filter
interface #19. It acts similar to Reducer
, but it is about limiting chain entries.
Filter(*Entry) *Entry
method to check is entry meets filter conditionReducer
interface too, to be used in chainsDatetime
filter #19. Its based on this PR #11 by @pshevtsovStringParser
#24 by @pshevtsovgo
version up to 1.5
goconvey
for testsReader
examples #21TestGroupByReducer
#4, it was random crashing, because we could not expect the order of entries readed from an output channelAvg
, Sum
and Count
was introduces along with Chain
and GroupBy
reducers.Entry
got some new methods
Field(name string)
, FloatField(name string)
SetField(name string, value string)
, SetFloatField(name string, value float64)
, SetUintField(name string, uint64)
Merge(entry *Entry)
, FieldsHash(fields []string)
, Partial(fields []string)
*Entry
instead of Entry
MapReduce
returns chan *Entry
instead of chan interface{}
and all reducers accept output channel as chan *Entry
Entry
is a struct
, not a map[string]string
anymore and has two constructors NewEntry
that accepts Fields
and NewEmptyEntry
Entry.Get
was renamed to Entry.Field
Implement function MapReduce to parse log file in asynchronous manner for speed improvement. Reader.Read
and constructors signatures and behaviour still the same.
Log reader type Reader
with the following constructors
func NewReader(logFile io.Reader, format string) *Reader
func NewNginxReader(logFile io.Reader, nginxConf io.Reader, formatName string) (reader *Reader, err error)
And one interface method
func (r *Reader) Read() (record Entry, err error)