-
Notifications
You must be signed in to change notification settings - Fork 680
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 simple Logstash adapter #64
Conversation
func init() { | ||
router.AdapterFactories.Register(NewLogstashAdapter, "logstash") | ||
|
||
hostname, _ = os.Hostname() |
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's this?
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.
I see, it's a global. Maybe set this up as a field of the adapter object and do this in its constructor.
@progrium Updated with more Docker fields, similar to the fields in https://github.com/digital-wonderland/docker-logstash-forwarder. |
Why do you think JSON+UDP should be the canonical way logspout should send logs to logstash? |
I think UPD should be the default because it's faster for streaming logs, and there can be a lot from some docker containers. For more info: https://github.com/dwbutler/logstash-logger#what-type-of-logger-should-i-use |
Maybe it should just be called a JSON adapter then? |
Does this satisfy your use? |
I think your JSON adapter is a pretty cool implementation, but I would like to have both! My implementation is focused on performance as this is more important in our use case. |
I recommend putting this adapter in its own repo and building logspout On Friday, March 27, 2015, Max Persson [email protected] wrote:
Jeff Lindsay |
Sure, are there any guidelines on how to do that? |
The repo name should be prefixed with
Depending on how often you might change it and to what degree, I recommend versioning/tagging with gopkg.in conventions. This way people can use that for pinning if they wish. |
Will this be added to gliderlabs/logspout/modules.go or to my own fork? |
Anybody's fork. We'll list it as a third-party module in the readme. |
What I meant was when using logspout; will I be able to run your container with my module referenced in it, or would I create and push my own container from my own fork using my adapter? |
For now you need your own container fork. Eventually you can dynamically load modules at container boot. |
Ok, thanks for the info. |
This might make it easier for you: https://github.com/gliderlabs/logspout/pull/66/files |
I created a custom module instead, available here https://github.com/looplab/logspout-logstash. Closing this PR. |
This adds a simpler version of the Logstash UDP adapter created in github.com/gliderlabs/logspout.