You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/11/24 18:57:56 UTC

[GitHub] [camel] kremers opened a new pull request, #8774: camel-splunk-hec - Add endpoint url suffix configuration to enable op…

kremers opened a new pull request, #8774:
URL: https://github.com/apache/camel/pull/8774

   …tions and raw transports
   
   Trivial change, adding option to configure endpoint url suffix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus merged pull request #8774: camel-splunk-hec - Add endpoint url suffix configuration to enable op…

Posted by GitBox <gi...@apache.org>.
davsclaus merged PR #8774:
URL: https://github.com/apache/camel/pull/8774


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on a diff in pull request #8774: camel-splunk-hec - Add endpoint url suffix configuration to enable op…

Posted by GitBox <gi...@apache.org>.
davsclaus commented on code in PR #8774:
URL: https://github.com/apache/camel/pull/8774#discussion_r1032016103


##########
components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECConfiguration.java:
##########
@@ -99,6 +101,20 @@ public void setHost(String host) {
         this.host = host;
     }
 
+    /**
+     * Splunk endpoint
+     *   Defaults to /services/collector/event
+     *   To write RAW data like JSON use /services/collector/raw
+     *   To extract timestamps in Splunk>8.0 /services/collector/event?auto_extract_timestamp=true
+     */
+    public void setEndpoint(String endpoint) {

Review Comment:
   Are there other endpoints? And endpoint can maybe confuse as Camel also has a concept of endpoint. So maybe we can come up with a different name?
   
   For the last with the query parameter then that will not work as Camel think its another parameter.
   
   So maybe come up
   
   1) a new name, with 3 enum values: default, raw, timestamp
   2) And then you can set the url based on the endpoint inside the camel component



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #8774: camel-splunk-hec - Add endpoint url suffix configuration to enable op…

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8774:
URL: https://github.com/apache/camel/pull/8774#issuecomment-1328013669

   :leftwards_arrow_with_hook: There are either **too many** changes to be tested in this PR or the code **needs be rebased**: (31 components likely to be affected)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] kremers commented on pull request #8774: camel-splunk-hec - Add endpoint url suffix configuration to enable op…

Posted by GitBox <gi...@apache.org>.
kremers commented on PR #8774:
URL: https://github.com/apache/camel/pull/8774#issuecomment-1326825499

   Added test and default value in [60c65f8]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on a diff in pull request #8774: camel-splunk-hec - Add endpoint url suffix configuration to enable op…

Posted by GitBox <gi...@apache.org>.
davsclaus commented on code in PR #8774:
URL: https://github.com/apache/camel/pull/8774#discussion_r1032757600


##########
components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECConfiguration.java:
##########
@@ -36,6 +36,8 @@ public class SplunkHECConfiguration {
     private String source = "camel";
     @UriParam
     private String host;
+    @UriParam(defaultValue = "/services/collector/event")
+    private String splunkRESTEndpoint = "/services/collector/event";

Review Comment:
   Thanks that was quick



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] kremers commented on a diff in pull request #8774: camel-splunk-hec - Add endpoint url suffix configuration to enable op…

Posted by GitBox <gi...@apache.org>.
kremers commented on code in PR #8774:
URL: https://github.com/apache/camel/pull/8774#discussion_r1032265181


##########
components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECConfiguration.java:
##########
@@ -99,6 +101,20 @@ public void setHost(String host) {
         this.host = host;
     }
 
+    /**
+     * Splunk endpoint
+     *   Defaults to /services/collector/event
+     *   To write RAW data like JSON use /services/collector/raw
+     *   To extract timestamps in Splunk>8.0 /services/collector/event?auto_extract_timestamp=true
+     */
+    public void setEndpoint(String endpoint) {

Review Comment:
   Hi Claus, thank you very much for your quick reply and check of the PR!
   
   - Thank you very mich for the hint with the name, okay to set it to "SplunkRESTEndpoint"? Which would be a better naming. 
   
   - If the url includes a question mark the user can utilize RAW{} https://camel.apache.org/manual/faq/how-do-i-configure-endpoints.html#HowdoIconfigureendpoints-Configuringparametervaluesusingrawvalues so it will work. Modules like azure-eventhub do make excessive use of it for connection strings, passwords, ... for example:
   
   `.from(azure-eventhubs:?connectionString=RAW({{camel.component.azure-eventhubs.connection-string}}) ...`
   
   - For the reason of extendability, enum does not sound like a good fit to me, since it requires changes to the software and different versions in place on every new Splunk version/endpoint. The ENUM may also suggest RESTEndpoints that are not available in older Splunk versions. So I suggest to stick with a strong default that does not introduce a breaking change, but full flexibility to adpot to new Splunk versions without changing the camel module. See: https://docs.splunk.com/Documentation/SplunkCloud/8.2.2203/Data/HECRESTendpoints
   
   - Naming in the module can be improved a lot, since hostAndIp are written aus SplunkURL where users normally expect an URL compliant to RFC1738 (https://datatracker.ietf.org/doc/html/rfc1738) including the REST endpoint including http or https (including RAW() for handling slashes). One possible way to improve and keep backwards compability would be introduction of a configuration parameter "connectionString" that has first priority if set and includes all information. But I guess that is better adressed in a second pull request.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #8774: camel-splunk-hec - Add endpoint url suffix configuration to enable op…

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8774:
URL: https://github.com/apache/camel/pull/8774#issuecomment-1326828862

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 1 | 1 | 1 | 0 |


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] kremers commented on a diff in pull request #8774: camel-splunk-hec - Add endpoint url suffix configuration to enable op…

Posted by GitBox <gi...@apache.org>.
kremers commented on code in PR #8774:
URL: https://github.com/apache/camel/pull/8774#discussion_r1032755328


##########
components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECConfiguration.java:
##########
@@ -36,6 +36,8 @@ public class SplunkHECConfiguration {
     private String source = "camel";
     @UriParam
     private String host;
+    @UriParam(defaultValue = "/services/collector/event")
+    private String splunkRESTEndpoint = "/services/collector/event";

Review Comment:
   Yes, I'll change it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #8774: camel-splunk-hec - Add endpoint url suffix configuration to enable op…

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8774:
URL: https://github.com/apache/camel/pull/8774#issuecomment-1327488158

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 13 | 13 | 3 | 11 |


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on a diff in pull request #8774: camel-splunk-hec - Add endpoint url suffix configuration to enable op…

Posted by GitBox <gi...@apache.org>.
davsclaus commented on code in PR #8774:
URL: https://github.com/apache/camel/pull/8774#discussion_r1032391153


##########
components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECConfiguration.java:
##########
@@ -99,6 +101,20 @@ public void setHost(String host) {
         this.host = host;
     }
 
+    /**
+     * Splunk endpoint
+     *   Defaults to /services/collector/event
+     *   To write RAW data like JSON use /services/collector/raw
+     *   To extract timestamps in Splunk>8.0 /services/collector/event?auto_extract_timestamp=true
+     */
+    public void setEndpoint(String endpoint) {

Review Comment:
   Thanks for the detailed feedback. Yeah components can surely be improved, you are welcome to send more PRs.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on a diff in pull request #8774: camel-splunk-hec - Add endpoint url suffix configuration to enable op…

Posted by GitBox <gi...@apache.org>.
davsclaus commented on code in PR #8774:
URL: https://github.com/apache/camel/pull/8774#discussion_r1032751956


##########
components/camel-splunk-hec/src/main/java/org/apache/camel/component/splunkhec/SplunkHECConfiguration.java:
##########
@@ -36,6 +36,8 @@ public class SplunkHECConfiguration {
     private String source = "camel";
     @UriParam
     private String host;
+    @UriParam(defaultValue = "/services/collector/event")
+    private String splunkRESTEndpoint = "/services/collector/event";

Review Comment:
   Cane we use `splunkEndpoint` instead as upper-case REST make it a bit more unusual and a bit harder to read.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] kremers commented on pull request #8774: camel-splunk-hec - Add endpoint url suffix configuration to enable op…

Posted by GitBox <gi...@apache.org>.
kremers commented on PR #8774:
URL: https://github.com/apache/camel/pull/8774#issuecomment-1326827633

   Fixed checkstyle error from automated testing in [b999da5]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #8774: camel-splunk-hec - Add endpoint url suffix configuration to enable op…

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8774:
URL: https://github.com/apache/camel/pull/8774#issuecomment-1326775975

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :warning: Please note that the changes on this PR may be **tested automatically**. 
   
   If necessary Apache Camel Committers may access logs and test results in the job summaries!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org