.. _influx-d-b-sink-connector: InfluxDB Sink ============= The InfluxDB sink connector is used to write data from a :term:`Kafka topic`_ to an InfluxDB host. When there are more than one record in a batch that have the same measurement, time, and tags, they will be combined to a single point an written to InfluxDB in a batch. .. _influx-d-b-sink-connector-examples: Examples -------- Property based example ^^^^^^^^^^^^^^^^^^^^^^ This configuration is used typically along with :ref:`standalone workers `. .. code-block:: properties :name: connector.properties :emphasize-lines: 4,5 name=InfluxDBSinkConnector1 connector.class=io.confluent.influxdb.InfluxDBSinkConnector tasks.max=1 topics=< Required Configuration > influxdb.url=< Required Configuration > Rest based example ^^^^^^^^^^^^^^^^^^ This configuration is used typically along with :ref:`distributed workers `. Write the following json to `connector.json`, configure all of the required values, and use the command below to post the configuration to one the distributed connect worker(s). Check here for more information about the Kafka Connect :ref:`Rest API ` .. code-block:: json :caption: Connect Distributed REST example :name: connector.json :emphasize-lines: 6,7 { "config" : { "name" : "InfluxDBSinkConnector1", "connector.class" : "io.confluent.influxdb.InfluxDBSinkConnector", "tasks.max" : "1", "topics" : "< Required Configuration >", "influxdb.url" : "< Required Configuration >" } } Use curl to post the configuration to one of the Kafka Connect Workers. Change `http://localhost:8083/` the the endpoint of one of your Kafka Connect worker(s). .. code-block:: bash :caption: Create a new connector curl -s -X POST -H 'Content-Type: application/json' --data @connector.json http://localhost:8083/connectors .. code-block:: bash :caption: Update an existing connector curl -s -X PUT -H 'Content-Type: application/json' --data @connector.json http://localhost:8083/connectors/InfluxDBSinkConnector1/config