Docker kafka connector fork of https://github.com/splunk/kafka-connect-splunk for my personnal learning of kafka.
The image contain the necessary to recompile the connector from sources.
A persistent volume can be bind to /opt/splunk-kafka-connect/config defaut on the docker-compose is map to ./mount/config
Must contain the configuration : connect-distributed.properties
In this file edit the parameter bootstrap.servers to match your(s) server(s) url.
Use makefile to start container via docker-compose
run or up: Run container in console mode daemon: Run container in daemon mode restart: Restart the daemon stop: Stop container shell bash: Launch shell in container
Logs of the connector and supervisor are put in /var/log/supervisor (can be mount)
Logrotate applied a compression and rotation for 14 days
Enable collector :
Settings → Data Input → HTTP Event Collector → Global settings
Create New Token :
Settings → Data Input → HTTP Event Collector → New Token
( Enable indexer acknowledgement must be enabled )
curl 192.168.2.38:8083/connectors -X POST -H "Content-Type: application/json" -d'{ "name": "splunk-prod", "config": { "connector.class": "com.splunk.kafka.connect.SplunkSinkConnector", "tasks.max": "2", "topics": "mytopic,t1", "splunk.hec.uri":"https://192.168.2.38:8088", "splunk.hec.token": "2e8c1aba-9218-4a65-a232-fa0782a7dcf0", "splunk.hec.ack.enabled" : "true", "splunk.hec.ssl.validate.certs" : "false", "splunk.hec.raw" : "false", "splunk.hec.json.event.enrichment" : "org=fin,bu=daki", "splunk.hec.track.data" : "true", "splunk.hec.max.batch.size":"50" } }'
splunk.hec.max.batch.size : Maximum batch size when posting events to Splunk. The size is the actual number of Kafka events, and not byte size. By default, this is set to 100.
Be careful with "splunk.hec.ack.enabled" that must match the setting of the Splunk HEC.
curl http://192.168.2.38:8083/connectors
curl http://192.168.2.38:8083/connectors/splunk-prod -X DELETE
make build
or make build-nc Build the container without caching
make daemon make shell /opt/src/build.sh