influxdata / go-syslog

Blazing fast syslog parser
MIT License
476 stars 69 forks source link

RFC3164 #27

Closed leodido closed 4 years ago

leodido commented 4 years ago

This PR finally implements RFC3164 parsing! 😃

It fixes #15 when merged in.

Notice it changes the syslog.Message interface and it introduces a syslog.Base struct containing the common fields between the two Syslog formats.

This means I'll need to release another major (v3) when completed 100% (see below).

Missing pieces at the moment:

gianarb commented 4 years ago

Hello @leodido ! Thank you for this contrib

--- FAIL: TestMachineParse (0.00s)
    --- FAIL: TestMachineParse/<34>Jan_12_06:30:00_xxx_apache_server:_1.2.3.4_-_- (0.00s)
        <autogenerated>:1: 
                Error Trace:    machine_test.go:49
                Error:          Should NOT be empty, but was &{<nil> <nil> <nil> 0 <nil> <nil> <nil> <nil> <nil> <nil> <nil>}
                Test:           TestMachineParse/<34>Jan_12_06:30:00_xxx_apache_server:_1.2.3.4_-_-
FAIL

This is the failing test atm

leodido commented 4 years ago

This was the reason I put the PR as a draft (with WIP prefix). Anyway I have other commits to push :)

leodido commented 4 years ago

greeeeeeeny 💚

leodido commented 4 years ago

@goller I want your review my friend plzzz 🤗

But please DO NOT merge yet :)

goller commented 4 years ago

@leodido you rock!

I think I'll start by reading through the structural changes.

Next, I'll read 3164 again and look closely at the grammar.

russorat commented 4 years ago

Really looking forward to this!!!

leodido commented 4 years ago

Hey, @goller your test (https://github.com/influxdata/go-syslog/pull/27/commits/db2b9df413ba9a2f76f4d4cdec4b0e07d8eda753) was not passing because of missing whitespace at the start of the MSG part.

If you think that such BSD-syslog messages (no whitespace space between the TAG/CONTENT end - ':' - and the MSG start) are very common we could think to provide an option to parse them as correct ones.

leodido commented 4 years ago

Friendly ping! @goller 😃

russorat commented 4 years ago

is this really happening?! I'm so excited! Thank you for the great work here @leodido !