Skip to content

Commit a10a336

Browse files
author
Donald Tregonning
authored
modified string split to support ',' and ', ' (#182)
1 parent ff4045d commit a10a336

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ private Event createHecEventFrom(final SinkRecord record) {
363363
return event;
364364
}
365365

366-
JsonEvent event = null;
366+
JsonEvent event;
367367
ObjectMapper objectMapper = new ObjectMapper();
368368

369369
if(connectorConfig.hecEventFormatted) {
@@ -424,7 +424,7 @@ private Event addHeaders(Event event, SinkRecord record) {
424424
// Custom headers are configured with a comma separated list passed in configuration
425425
// "custom_header_1,custom_header_2,custom_header_3"
426426
if (!connectorConfig.headerCustom.isEmpty()) {
427-
String[] customHeaders = connectorConfig.headerCustom.split(",");
427+
String[] customHeaders = connectorConfig.headerCustom.split(",\\s?");
428428
Map<String, String> headerMap = new HashMap<>();
429429
for (String header : customHeaders) {
430430
Header customHeader = headers.lastWithName(header);

0 commit comments

Comments
 (0)