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 a Syslog octet counting frame decoder. (RFC6587) #743
Conversation
I started with a FrameDecoder and am now working on the transport integration. |
ac683e2
to
0f941b0
Compare
|
||
@Override | ||
public String linkToDocs() { | ||
return ""; |
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 could link to http://www.graylog2.org/resources/documentation/sending/syslog but we'd need to add a section about syslog-ng and maybe a section on how to create a Syslog Input in Graylog2 to that document.
0f941b0
to
b8a3a8f
Compare
private boolean usesOctetCountFraming(MessageEvent e) { | ||
final ChannelBuffer message = (ChannelBuffer) e.getMessage(); | ||
|
||
return Character.isDigit(message.getByte(0)); |
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.
Could the ChannelBuffer
ever be empty? If it can, this could throw an IndexOutOfBoundsException
.
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.
While it's rather unlikely to happen here, Character#isDigit(char)
matches much more than just [0-9]. Maybe rather use return '0' <= message.getByte(0) && message.getByte(0) <= '9';
instead.
LGTM! 👍 |
Also adjust to refactored transports.
29c8d8f
to
21ee772
Compare
Merged via squash commit 6a77e02. |
See: http://tools.ietf.org/html/rfc6587#section-3.4.1 Autodetect framing type to transparently support both methods on the same input.
See: http://tools.ietf.org/html/rfc6587#section-3.4.1