You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/10/03 10:00:20 UTC
camel git commit: CAMEL-9187 add eventHost parameter to endpoint to
support splunk host override per:
http://docs.splunk.com/Documentation/Splunk/6.2.6/Data/Aboutdefaultfields#Override_host_assignment
Repository: camel
Updated Branches:
refs/heads/master d5f0aefdf -> 0f2d23260
CAMEL-9187 add eventHost parameter to endpoint to support splunk host override per: http://docs.splunk.com/Documentation/Splunk/6.2.6/Data/Aboutdefaultfields#Override_host_assignment
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0f2d2326
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0f2d2326
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0f2d2326
Branch: refs/heads/master
Commit: 0f2d2326003b26ac3686c5be97cfda5ec06d592e
Parents: d5f0aef
Author: Doug <dw...@isg.la>
Authored: Fri Oct 2 08:02:51 2015 -0700
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Oct 3 09:58:14 2015 +0200
----------------------------------------------------------------------
.../camel/component/splunk/SplunkConfiguration.java | 14 ++++++++++++++
.../apache/camel/component/splunk/SplunkProducer.java | 3 +++
.../splunk/SplunkComponentConfigurationTest.java | 3 ++-
3 files changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/0f2d2326/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkConfiguration.java b/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkConfiguration.java
index daff832..30d5efb 100644
--- a/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkConfiguration.java
+++ b/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkConfiguration.java
@@ -60,6 +60,8 @@ public class SplunkConfiguration {
@UriParam(label = "producer")
private String source;
@UriParam(label = "producer")
+ private String eventHost;
+ @UriParam(label = "producer")
private int tcpReceiverPort;
@UriParam(label = "producer", defaultValue = "false")
private boolean raw;
@@ -186,6 +188,17 @@ public class SplunkConfiguration {
this.source = source;
}
+ public String getEventHost() {
+ return eventHost;
+ }
+
+ /**
+ * Override the default Splunk event host field
+ */
+ public void setEventHost(String eventHost) {
+ this.eventHost = eventHost;
+ }
+
/**
* Splunk index to write to
*/
@@ -359,4 +372,5 @@ public class SplunkConfiguration {
splunkConnectionFactory.setSslProtocol(getSslProtocol());
return splunkConnectionFactory;
}
+
}
http://git-wip-us.apache.org/repos/asf/camel/blob/0f2d2326/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkProducer.java b/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkProducer.java
index 139f68c..9cc8e46 100644
--- a/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkProducer.java
+++ b/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkProducer.java
@@ -103,6 +103,9 @@ public class SplunkProducer extends DefaultProducer {
if (endpoint.getConfiguration().getSource() != null) {
args.put("source", endpoint.getConfiguration().getSource());
}
+ if (endpoint.getConfiguration().getEventHost() != null) {
+ args.put("host", endpoint.getConfiguration().getEventHost());
+ }
return args;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/0f2d2326/components/camel-splunk/src/test/java/org/apache/camel/component/splunk/SplunkComponentConfigurationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-splunk/src/test/java/org/apache/camel/component/splunk/SplunkComponentConfigurationTest.java b/components/camel-splunk/src/test/java/org/apache/camel/component/splunk/SplunkComponentConfigurationTest.java
index c933c4c..7c64a95 100644
--- a/components/camel-splunk/src/test/java/org/apache/camel/component/splunk/SplunkComponentConfigurationTest.java
+++ b/components/camel-splunk/src/test/java/org/apache/camel/component/splunk/SplunkComponentConfigurationTest.java
@@ -52,7 +52,7 @@ public class SplunkComponentConfigurationTest extends CamelTestSupport {
SplunkEndpoint endpoint = (SplunkEndpoint)component
.createEndpoint("splunk://tcp?username=test&password=pw&host=myhost&port=3333&" + "tcpReceiverPort=4444&index=myindex&sourceType=testSource&"
- + "source=test&owner=me&app=fantasticapp&useSunHttpsHandler=true&raw=true&sslProtocol=SSLv3");
+ + "source=test&eventHost=original-host.com&owner=me&app=fantasticapp&useSunHttpsHandler=true&raw=true&sslProtocol=SSLv3");
assertEquals("myhost", endpoint.getConfiguration().getHost());
assertEquals(3333, endpoint.getConfiguration().getPort());
assertEquals("test", endpoint.getConfiguration().getUsername());
@@ -61,6 +61,7 @@ public class SplunkComponentConfigurationTest extends CamelTestSupport {
assertEquals("myindex", endpoint.getConfiguration().getIndex());
assertEquals("testSource", endpoint.getConfiguration().getSourceType());
assertEquals("test", endpoint.getConfiguration().getSource());
+ assertEquals("original-host.com", endpoint.getConfiguration().getEventHost());
assertEquals("me", endpoint.getConfiguration().getOwner());
assertEquals("fantasticapp", endpoint.getConfiguration().getApp());
assertTrue(endpoint.getConfiguration().isUseSunHttpsHandler());