-
Notifications
You must be signed in to change notification settings - Fork 104
Uri validator bug #376
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
Uri validator bug #376
Conversation
LGTM! |
Thank you @tebriel for finding and fixing the bug. We had multiple support cases where customers had an issue with splunk configurations and logs were not doing a great job of finding it. So, we decided to add pre-validation to those configurations. It will allow the detection of these issues ASAP. But it looks like we have missed this one. Now that we have found this bug, there is a chance that there will be more bugs as well. What do you think about making validation configurable as a user? |
@harshit-splunk that was my first thought when I saw this bug, either a non-creating API for connector/validate which takes the JSON or a flag of validate={true,false} in the URL parameters to be able to skip the validation if I feel like it's not doing the right thing. I haven't written Java professionally before, so this is just me copying the style of other bits of code and cobbling them together. I could take a stab at the validate query parameter but I'm not sure if one of the maintainers would be able to do so better/faster. |
After looking at the SinkConnector Java class and remembering that we're being called through Kafka-Connect, I don't know that there is a direct way to avoid validation. I think for a separate PR someone could add a new splunk connector configuration value of |
Yes, we'll create a separate PR for that feature i.e. to make validations configurable. |
Fixes #375 which outlined a bug with the new config validation.
The
splunk.hec.uri
can be either a single URI or a comma-separated list. This PR updates the config validation to split the URI on,
like we do in configuration processing, and then use the first URI to validate.I think this could potentially run into edge cases where you've mixed http and https URIs in the
splunk.hec.uri
setting, though if you're doing this maybe you don't really want validation anyways.Added a test case which errored before the change and passed after, hopefully this is sufficient to un-break
v2.1.0
./cc @deep-splunk @harshit-splunk