Specify these settings to send data over a secure connection to Kafka. In the {fleet} Output settings, make sure that the Kafka output type is selected.
Note
|
If you plan to use {ls} to modify {agent} output data before it’s sent to Kafka, please refer to our guidance for doing so, further in on this page. |
Kafka version |
The Kafka protocol version that {agent} will request when connecting.
Defaults to |
Hosts |
The addresses your {agent}s will use to connect to one or more Kafka brokers.
Use the format Examples:
Refer to the {fleet-server} documentation for default ports and other configuration details. |
Select the mechanism that {agent} uses to authenticate with Kafka.
None |
No authentication is used between {agent} and Kafka. This is the default option. In production, it’s recommended to have an authentication method selected.
|
Username / Password |
Connect to Kafka with a username and password. Provide your username and password, and select a SASL (Simple Authentication and Security Layer) mechanism for your login credentials. When SCRAM is enabled, {agent} uses the SCRAM mechanism to authenticate the user credential. SCRAM is based on the IETF RFC5802 standard which describes a challenge-response mechanism for authenticating users.
To prevent unauthorized access your Kafka password is stored as a secret value. While secret storage is recommended, you can choose to override this setting and store the password as plain text in the agent policy definition. Secret storage requires {fleet-server} version 8.12 or higher. Note that this setting can also be stored as a secret value or as plain text for preconfigured outputs. See {kibana-ref}/fleet-settings-kb.html#_preconfiguration_settings_for_advanced_use_cases[Preconfiguration settings] in the {kib} Guide to learn more. |
SSL |
Authenticate using the Secure Sockets Layer (SSL) protocol. Provide the following details for your SSL certificate:
|
Server SSL certificate authorities |
The CA certificate to use to connect to Kafka. This is the CA used to generate the certificate and key for Kafka. Copy and paste in the full contents for the CA certificate. This setting is optional. This setting is not available when the authentication Click Add row to specify additional certificate authories. |
Verification mode |
Controls the verification of server certificates. Valid values are:
The default value is |
The number of partitions created is set automatically by the Kafka broker based on the list of topics. Records are then published to partitions either randomly, in round-robin order, or according to a calculated hash.
Random |
Publish records to Kafka output broker event partitions randomly. Specify the number of events to be published to the same partition before the partitioner selects a new partition. |
Round robin |
Publish records to Kafka output broker event partitions in a round-robin fashion. Specify the number of events to be published to the same partition before the partitioner selects a new partition. |
Hash |
Publish records to Kafka output broker event partitions based on a hash computed from the specified list of fields. If a field is not specified, the Kafka event key value is used. |
Use this option to set the Kafka topic for each {agent} event.
Default topic |
Set a default topic to use for events sent by {agent} to the Kafka output. You can set a static topic, for example
You can also set a custom field. This is useful if you’re using the |
A header is a key-value pair, and multiple headers can be included with the same key. Only string values are supported. These headers will be included in each produced Kafka message.
Key |
The key to set in the Kafka header. |
Value |
The value to set in the Kafka header. Click Add header to configure additional headers to be included in each Kafka message. |
Client ID |
The configurable ClientID used for logging, debugging, and auditing purposes. The default is |
You can enable compression to reduce the volume of Kafka output.
Codec |
Select a compression codec to use. Supported codecs are |
Level |
For the Increasing the compression level reduces the network usage but increases the CPU usage. The default value is 4. |
Configure timeout and buffer size values for the Kafka brokers.
Broker timeout |
The maximum length of time a Kafka broker waits for the required number of ACKs before timing out (see the |
Broker reachability timeout |
The maximum length of time that an {agent} waits for a response from a Kafka broker before timing out. The default is 30 seconds. |
ACK reliability |
The ACK reliability level required from broker. Options are:
The default is Note that if ACK reliability is set to |
Key |
An optional formatted string specifying the Kafka event key. If configured, the event key can be extracted from the event using a format string. See the Kafka documentation for the implications of a particular choice of key; by default, the key is chosen by the Kafka cluster. |
Proxy |
Select a proxy URL for {agent} to connect to Kafka. To learn about proxy configuration, refer to [fleet-agent-proxy-support]. |
Advanced YAML configuration |
YAML settings that will be added to the Kafka output section of each policy that uses this output. Make sure you specify valid YAML. The UI does not currently provide validation. See Advanced YAML configuration for descriptions of the available settings. |
Make this output the default for agent integrations |
When this setting is on, {agent}s use this output to send data if no other output is set in the agent policy. |
Make this output the default for agent monitoring |
When this setting is on, {agent}s use this output to send agent monitoring data if no other output is set in the agent policy. |
Setting | Description |
---|---|
|
(string) The number of seconds to wait before trying to reconnect to Kafka
after a network error. After waiting Default: |
|
(string) The maximum number of seconds to wait before attempting to connect to Kafka after a network error. Default: |
|
(int) The maximum number of events to bulk in a single Kafka request. Default: |
|
(int) Duration to wait before sending bulk Kafka request. Default: |
|
(int) Per Kafka broker number of messages buffered in output pipeline. Default: |
|
(string) The configurable ClientID used for logging, debugging, and auditing purposes. Default: |
|
Output codec configuration. You can specify either the
Example configuration that uses the output.console:
codec.json:
pretty: true
escape_html: false
Example configurable that uses the output.console:
codec.format:
string: '%{[@timestamp]} %{[message]}' Default: |
|
(string) The keep-alive period for an active network connection. If Default: |
|
(int) The maximum permitted size of JSON-encoded messages. Bigger messages will be dropped. This value should be equal to or less than the broker’s Default: |
|
Kafka metadata update settings. The metadata contains information about brokers, topics, partition, and active leaders to use for publishing.
|
If you are considering using {ls} to ship the data from kafka
to {es}, please
be aware the structure of the documents sent from {agent} to kafka
must not be modified by {ls}.
We suggest disabling ecs_compatibility
on both the kafka
input and the json
codec in order
to make sure the input doesn’t edit the fields and their contents.
The data streams setup by the integrations expect to receive events having the same structure and field names as they were sent directly from an {agent}.
The structure of the documents sent from {agent} to kafka
must not be modified by {ls}.
We suggest disabling ecs_compatibility
on both the kafka
input and the json
codec.
Refer to the {ls} output for {agent} documentation for more details.
inputs {
kafka {
...
ecs_compatibility => "disabled"
codec => json { ecs_compatibility => "disabled" }
...
}
}
...