-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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 Splunk logging driver #16207 #16488
Conversation
This PR is for #16207 |
Updated OP's description to include the issue it fixes (so that it automatically closes it if this PR is merged) |
@@ -270,6 +270,7 @@ __docker_log_drivers() { | |||
json-file | |||
none | |||
syslog | |||
splunk |
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.
Please insert this in alphabetical order. This also applies to the other additions.
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.
Fixed!
Thanks very much for also implementing bash completion. That's really cool stuff! |
@albers thank you for review! Just updated PR |
Bash completion LGTM. Thanks for updating. |
Didn't read the code, but I'm +1 for a splunk driver since we already have many similar logging drivers. |
ping @sdurrheimer zsh completion: new log-driver |
0c6955f
to
5c8a50b
Compare
@outcoldman Is there any easy way to test driver? |
@LK4D4 it depends on the definition of "easy". I did all my tests manually. To test it we need to
Do you think that we can perform first 2 steps? Do you have an example? |
@outcoldman I mean test manually, not unit-tests. Yes, I thought maybe you have docker image with splunk. |
Ah, I see, so you are asking for instructions how to test it manually. This make sense.
|
@@ -0,0 +1,256 @@ | |||
// +build linux |
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.
@LK4D4 one question about this line. I saw it in other logging drivers. What is the purpose of this line? As we don't use anything special - our driver should work everywhere where you can run the daemon.
Is it some kind of transition to Windows? Our driver should work on Windows out of box. Should I remove it?
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.
Yup, you should remove it then.
Actually let's ask @jhowardmsft too :)
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.
Yeah, if it works on Windows and you've verified it does, then remove the line. But you'll need a line added to daemon\logdrivers_windows.go too to add splunk.
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.
Supporting Windows is not critical right now as the WIndows support for Docker is till being developed. Once it settles, we'll revisit. We certainly would like long term for it to work on Windows.
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.
Ok, so per @glennblock we do not support Windows right now. I mean it should work, but we have not tested it.
Should I keep this line for now?
Btw, do I need to have special file "splunk_unsupported.go"?
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.
@jhowardmsft the driver technically should work, but the test effort for us to verify on Windows is pretty significant today, based on our recent eval. Is this something that you guys could help us with? We'd be happy to get you a Splunk instance you could test pushing to.
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.
@LK4D4 the Splunk instance can be running on any platform. The driver is just making simple HTTP requests, so I don't see why it would not work on Windows.
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.
@glennblock - Would be happy to verify, just not immediately, busy getting the last few pieces in for technical preview 4 of Windows Server 2016. Drop me a line.
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.
Will do, thanks @jhowardmsft!
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.
Let's remove tag now. It'll work on windows as well.
@outcoldman thanks, I'll try. Moving to code-review in the meantime. |
btw need rebase, sorry :) |
b6f7df6
to
9f9c075
Compare
@LK4D4 np, rebased! |
@@ -304,7 +304,7 @@ Json Parameters: | |||
systems, such as SELinux. | |||
- **LogConfig** - Log configuration for the container, specified as a JSON object in the form | |||
`{ "Type": "<driver_name>", "Config": {"key1": "val1"}}`. | |||
Available types: `json-file`, `syslog`, `journald`, `gelf`, `awslogs`, `none`. | |||
Available types: `json-file`, `syslog`, `journald`, `gelf`, `awslogs`, `splunk`, `none`. |
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 getting long. Maybe it should be sorted alpha, with "none" remaining at the end?
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.
hm, yes, we can do that; possible none
as the first. I'm fine with leaving that for another PR though.
@outcoldman since this won't make it into docker 1.9, these changes should be moved to docker_remote_api_v1.22.md
now
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.
@thaJeztah good point, will move it to 1.22
I would recommend accepting both username & password, as well as http event collector tokens. |
Hi @phemmer Thanks for the input. Event Collector is available in Splunk Cloud, but it needs to be enabled via a support request. There's no UI yet for self-service. But it is definitely available. Please contact Splunk Cloud support and they will get you up and running. As to the username / password. Going forward we will encourage people not to use the REST API to send events as it requires a username and password that can potentially leak access to Splunk. Also EC has been designed in a more scalable / available fashion than the receiver endpoints. Event Collector tokens are not attached to user credentials, they are specifically designed just for logging events. It is a special endpoint that only allows sending data with a valid token. This makes it more secure from a Splunk perspective as using the token will not allow accessing any part of Splunk, you can't even authenticate to the management port (8089) with the token. Does that make sense? You are correct that it is only in Splunk 6.3, but you can stand up dedicated Event Collector instances within a 6.2 environment and they will work fine. EC can run anywhere, an indexer, a forwarder, etc. |
Sweet!
|
I'd recommend clarifying that one paragraph. Otherwise, LGTM |
Oh, boy.. looks like this needs a rebase :'( sorry for that @outcoldman edit: sorry for the wrong ping @mountkin, autocomplete hit me :( |
Allow to send Splunk logs using Http Event Collector Signed-off-by: Denis Gladkikh <denis@gladkikh.email>
ca2d315
to
1f1dbf3
Compare
@thaJeztah np, rebased! |
Al green! merging \o/ |
Add Splunk logging driver #16207
@outcoldman @glennblock congrats! |
Thank you all for helping! And my personal huge thank to the @LK4D4. |
Thanks for contributing @outcoldman open source FTW! |
Yay!!!! This rocks!
|
Thank you all! We are seeing a lot of interest in Docker in our Splunk
|
Keewl! =) |
@thaJeztah Looks like this was missed and not cherry picked in. Any idea when 1.9.3 is going out? |
@moxiegirl I dunno why you think it should be in a milestone. It's a new feature == shouldn't be in the minor release. |
There was some confusion about the timing, but this PR was merged after the 1.9.0 code freeze (1.9.0-rc1 was released on October 14th). This driver will be part of the 1.10 release. For people wanting to give it a spin before that, it is available in the "Experimental" or "Master" builds (not intended for production) |
Our understanding was it was part of 1.10. Thanks for confirming. On Thu, Dec 10, 2015 at 4:48 PM Sebastiaan van Stijn <
|
Maybe the splunk driver could receive more than one host in "--log-opt splunk-url" for the cases splunk running in cluster ? |
Thanks for the suggestion. With HEC the recommendation is always to have a load balancer in front of the HEC pool. Based on that I don't think we need clustering support. Also that will complicate the implementation. |
Allow to send Splunk logs using Http Event Collector
Signed-off-by: Denis Gladkikh denis@gladkikh.email
Fixes #16207