This section describes the prerequisites and restrictions for using the kafka-c() destination, and important information about the declaration of the destination.
Prerequisites and restrictions
- The
kafka-c()destination uses the librdkafka client library. - If you used the Java implementation before, see Shifting from Java implementation to C implementation.
- The AxoSyslog
kafka-c()destination supports all properties of the official Kafka producer. For details, see the librdkafka documentation. - For the list of options, see Options of the kafka() destination’s C implementation.
Declaration:
kafka-c(
bootstrap-servers("1.2.3.4:9092,192.168.0.2:9092")
topic("MYTOPIC")
);Example: Sending log data to Apache Kafka
The following example defines a kafka-c destination, using only the required options.
destination d_kafka {
kafka-c(
bootstrap-servers("1.2.3.4:9092,192.168.0.2:9092")
topic("MYTOPIC")
);
};You can also use the kafka() name, which is an SCL alias for kafka-c(). In that case, your configuration must contain @include "scl.conf". For details, see kafka: Publish messages to Apache Kafka.