-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more format handling to rfc3164, and passthrough output #57
Conversation
…ts, and add passthrough decoder
@@ -63,6 +52,74 @@ struct Pri { | |||
severity: Option<u8>, | |||
} | |||
|
|||
fn decode_rfc_standard(pri: &Pri, msg: &str, line: &str) -> Result<Record, &'static str> { | |||
// Decoding "usual" rfc input as advised in the rfc: [<pri>]<datetime> <hostname> <message> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usual is a bit of a weighed word here, recommended is probably better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough. will update the comment
} | ||
|
||
fn decode_rfc_custom(pri: &Pri, msg: &str, line: &str) -> Result<Record, &'static str> { | ||
// Decoding custom rfc input formatted as : [<pri>]<hostname>: <datetime>: <message> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happned when we find a slightly different one again? Or is this the only real offender in the wild?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one of device custom log formats, in this case for cisco devices, dates and hostnames makes flowgger compliant with nxos and ios. Most devices seem to comply with the recommanded usage. However there is for sure other formats. I cannot add all existing formats here, but the design update makes it easier to add them on case by case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
RFC3164 is very wide, and many (if not an) log format are allowed.
This pull requests improves the format accepted:
A passthrough output module has also been added. When using RFC3164 for instance, it allows pushing events received in different format while conserving them, rather than reformating them in a common format.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.