influxdata / go-syslog

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

RFC3164: parsing syslog without PRI part #30

Open dimonomid opened 4 years ago

dimonomid commented 4 years ago

When syslog is being saved to files, the PRI value is typically removed (I don't know real reason for that though, but it's just my observation). And go-syslog complains that it can't find a PRI value when parsing syslog files. I worked it around by prepending every line with some dummy priority before parsing, but could we add at least an option to support syslog messages without a PRI value?

Also, as of now the Parse method just takes a byte array, there is no option to parse from an io.Reader; it makes prepending messages expensive. Can we make it possible to parse from an io.Reader as well? (It probably warrants for a separate issue, but it's more of a related question for now, so leaving it here)

Thanks!

russorat commented 4 years ago

@dimonomid thanks for the suggestions. Those sound like great additions. We will consider it for a future release. Would you be willing to help by contributing to the library?

haimrubinstein commented 10 months ago

@russorat I know I'm a bit late :) I would love to contribute to this. I opened an issue on it https://github.com/influxdata/go-syslog/issues/52