Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Log parser in another format #45

Open
gadekalp opened this issue Oct 15, 2021 · 1 comment
Open

Log parser in another format #45

gadekalp opened this issue Oct 15, 2021 · 1 comment

Comments

@gadekalp
Copy link

Hello,

We are trying to use go-syslog parser to parse syslogs for one of our system but our logs are in format as below:

Oct 11 22:14:15 su: 'su root' failed for lonvick on /dev/pts/8

So is there any way/standard to parse the logs in this format?

as we have checked the go-syslog supports logs in format of

<152> Oct 11 22:14:15 su: 'su root' failed for lonvick on /dev/pts/8

Any help on this will be appreciated.

@leodido
Copy link
Collaborator

leodido commented Oct 19, 2021

Hello @gadekalp,

nope RFC 3164 mandates the PRI part (https://datatracker.ietf.org/doc/html/rfc3164#section-4.1.1) to exist.

And the corresponding parser doesn't have an option to make it optional, at the moment.

I'd suggest to simply prepend a "fake" PRI (eg., <1>) to your logs before handing them to go-syslog.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants