- Introduce
Filter
interface #19. It acts similar toReducer
, but it is about limiting chain entries.- Has
Filter(*Entry) *Entry
method to check is entry meets filter condition - Implements
Reducer
interface too, to be used in chains
- Has
Datetime
filter #19. Its based on this PR #11 by @pshevtsov- Introduce
StringParser
#24 by @pshevtsov
- Run test for
go
version up to1.5
- Linting fixes #13, #14 (thanks to @pshevtsov)
- More examples, espetially for reducers #17
- Use
goconvey
for tests
- Fixed
Reader
examples #21 - Long lines reading #23 by @pshevtsov
- Fix nginx conf parsing, deal with commented lines #25 by @jack1582
- Parsing last value without quotes was fixed, #9
- Tested for Go v1.3
- Fix issue #6 which causes parser to crash if some value in a log line was empty
- Fix
TestGroupByReducer
#4, it was random crashing, because we could not expect the order of entries readed from an output channel
- The aggregation reducers such as
Avg
,Sum
andCount
was introduces along withChain
andGroupBy
reducers. Entry
got some new methods- Getters
Field(name string)
,FloatField(name string)
- Setters
SetField(name string, value string)
,SetFloatField(name string, value float64)
,SetUintField(name string, uint64)
- Utility methods
Merge(entry *Entry)
,FieldsHash(fields []string)
,Partial(fields []string)
- Getters
- All functions deals with
*Entry
instead ofEntry
MapReduce
returnschan *Entry
instead ofchan interface{}
and all reducers accept output channel aschan *Entry
Entry
is astruct
, not amap[string]string
anymore and has two constructorsNewEntry
that acceptsFields
andNewEmptyEntry
Entry.Get
was renamed toEntry.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)