Skip to content

Commit b006847

Browse files
committed
Split the URI on comma and use the first one
1 parent 0d0d44b commit b006847

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/com/splunk/kafka/connect/SplunkSinkConnector.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
import java.io.IOException;
4343
import java.util.ArrayList;
44+
import java.util.Arrays;
4445
import java.util.List;
4546
import java.util.Map;
4647

@@ -170,7 +171,8 @@ private void preparePayloadAndExecuteRequest(SplunkSinkConnectorConfig connector
170171
};
171172
}
172173
String endpoint = "/services/collector";
173-
String url = connectorConfig.splunkURI + endpoint;
174+
List<String> hecURIs = Arrays.asList(connectorConfig.splunkURI.split(","));
175+
String url = hecURIs.get(0) + endpoint;
174176
final HttpPost httpPost = new HttpPost(url);
175177
httpPost.setHeaders(headers);
176178
EventBatch batch = new JsonEventBatch();
@@ -216,4 +218,4 @@ private void executeHttpRequest(final HttpUriRequest req, CloseableHttpClient ht
216218
}
217219
}
218220
}
219-
}
221+
}

0 commit comments

Comments
 (0)