kafka
Last updated
Last updated
The out_kafka2
Output plugin writes records into Apache Kafka.
out_kafka2
is included in td-agent
. Fluentd gem users will need to install the fluent-plugin-kafka
gem using the following command:
Please see the Configuration File article for the basic structure and syntax of the configuration file.
Please make sure that you have enough space in the buffer path directory. Running out of disk space is a problem frequently reported by users.
@type
(required)The value must be kafka2
.
brokers
(required/optional)The list of all seed brokers, with their host and port information.
Default: localhost:9092
topic_key
The field name for the target topic. If the field value is app
, this plugin writes events to the app
topic.
This field name must be included in the buffer chunk keys:
Default: topic
default_topic
The name of the default topic. (default: nil
)
This value will be used when the topic_key
field is missing.
<format>
DirectiveThe format of each message. The available options are json
, ltsv
, and formatter plugins.
Here is the json
example:
See formatter
article for more detail.
use_event_time
Set fluentd event time to Kafka's CreateTime
.
Default: false
(It means the current time.)
required_acks
The number of acks required per request.
Default: -1
compression_codec
The codec the producer uses to compress messages (default: nil
).
Default: nil
Available options: gzip
, snappy
For snappy
, you need to install snappy
gem by td-agent-gem
command.
@log_level
The @log_level
option allows the user to set different levels of logging for each plugin.
Supported log levels: fatal
, error
, warn
, info
, debug
, trace
.
Please see the logging article for further details.
For common output / buffer parameters, please check the following articles:
This page does not describe all the possible configurations. If you want to know about other configurations, please check the link below:
If this article is incorrect or outdated, or omits critical information, please let us know. Fluentd is an open-source project under Cloud Native Computing Foundation (CNCF). All components are available under the Apache 2 License.