Closed zsprackett closed 8 years ago
@jordansissel can you have a look at this and let me know what you'd need to change for logstash?
Thanks
Also looking at the changes now.
Didn't test it yet but it generally looks good from my side. :+1:
Sweet. I'm concerned about what the best strategy for dealing with exceptions is. I don't think we can hide them completely from the caller as silently dropping things basically defeats the purpose of using TCP in the first place. Maybe @jordansissel will have an opinion on what he'd like to see as a caller.
The UDP sender is by default sending the caused exception as GELF message. :)
Haven't tested either, but +1 on the proposal to support additional transports. Code reviewed and looks good to me.
In terms of exceptions, I think wrapping up exceptions in some kind of GELF::TransportException would make it easier for consumers of this library (like logstash) to react.
In logstash's case, if there's a transport error, logstash is likely to simply retry the call anyway, probably forever (with the goal of never dropping logs by default).
Alternately, from logstash's side, we could just use a "gelf" codec and then any input/output would be able to consume or produce gelf messages and any transport concerns go away.
For context, in case I missed any, codecs in logstash are used to separate transportation (input, output) concerns from serialization (gelf, json, gzip, protobuf, etc) concerns.
A GELF codec for logstash sounds good. However if would at least need a special UDP output because of the byte header that needs to be prepended when the message is chunked.
Also keep in mind that with TCP the GELF payload must not be GZIP/ZLIB compressed. (because of the \0
framing that easily breaks when compressed)
Oh yeah, I forgot about stateful udp transmission for chunking. Let's pretend I didn't say anything about codecs, then! ;)
:)
I'll keep an eye on this PR in case any questions appear.
After this merges/releases, we can update the gelf output for logstash to let you select a transport:
output { gelf { transport => "tcp" } }
or something?
I see this also adds support to multiple endpoints which are selected using round-robin. We can add support for this configuration in logstash as well.
@zsprackett please ping here when you consider this PR ready for merging. Thanks!
I think this is about as good as I'll get it at this point.
I have not forgotten this and will merge soon. :) Thanks!
i assumed it was still waiting on me to add tests. :) no worries...
+1
+1
TCP & GELF would be the bees knees. Any possibility of this getting merged soon?
+1
+1
+1
+1
@lennartkoopmann any new status of what needs to get done to get this merged? would be great to give logstash the ability to ship logs to graylog2 over tcp.
+1
Hey @lennartkoopmann - looks like this PR is merge-able - Are there any bits that we can do out here to help you out? I'm definitely in the banging-my-head-to-get-gelf+tcp camp over here, as I know @rajatvig is too! Thanks so much!
@zsprackett Could you please sign the TORCH Contributor Agreement as outlined in CONTRIBUTING.md and send it to hello@torch.sh? Other than that we're good to go.
:+1:
CA sent in today.
Hey @zsprackett,
we unfortunately have a timing problem here. The IP holding entity has changed to Graylog, Inc and we need to adapt the CA. This might take us a few days and you'll have to re-issue it. Sorry about that.
Thanks, Lennart
Hello all,
Thanks for your work on this - I'd really like to use it. Are there any updates you can share on the progress of getting this merged in?
Cheers, Craig
Is there any update?
Ping!
+1
+1
+1
+1
+1
In order to use a patched logstash to send logs to a graylog2 with TCP/TLS support. I base on this patch and I add the TLS support by forking TCP classes. I have encountered some issue with dead socket and half-dead socket (socket timeout because we use an HA proxy behind the graylog2 server). So, I add some more reliable check (read the socket after writing to catch more exception). That is my first code in ruby, so it may probably better, but it does the job.
Any update on when this might be merged in?
+1
:+1:
+1
On Tue, Jul 21, 2015 at 8:58 AM, Paul notifications@github.com wrote:
[image: :+1:]
— Reply to this email directly or view it on GitHub https://github.com/Graylog2/gelf-rb/pull/21#issuecomment-123296856.
What do i need to sign to get this merged?
@zsprackett Guessing it's this: https://www.graylog.org/contributing-to-graylog/
Resubmitted CLA
Thanks! @zsprackett for President 2016!
I needed this quite urgently so I forked the current master and merged @zsprackett's 3 commits in (TCP works quite smoothly btw, great job!)
You manage the TCP/UDP option by adding a default option protocol. So the gelf, add a protocol field by default with this patch (with 0 or 1 as value). This information is futile and I think it should not be added as a gelf field by default.
I also think that would be cleaner to move "module Protocol" for TCP definition from file "gelf.rb" to the begin of the file "ruby_sender.rb".
+1
Not final. I'm just submitting this for review. Still needs tests but it works and I want to make sure you're onboard.