# Kafka（Deprecated）

## 简介

`flusher_kafka` `flusher`插件可以实现将采集到的数据，经过处理后，发送到Kafka。

## 版本

[Deprecated](https://ilogtail.gitbook.io/ilogtail-docs/pre-release/plugins/stability-level)，请使用`flusher_kafka_v2`

## 版本说明

* 推荐版本：无

## 配置参数

| 参数              | 类型       | 是否必选 | 说明                                                                     |
| --------------- | -------- | ---- | ---------------------------------------------------------------------- |
| Type            | string   | 是    | 插件类型                                                                   |
| Brokers         | String数组 | 是    | Kafka Brokers                                                          |
| Topic           | string   | 是    | Kafka Topic                                                            |
| SASLUsername    | string   | 否    | SASL用户名                                                                |
| SASLPassword    | string   | 否    | SASL密码                                                                 |
| PartitionerType | string   | 否    | Partitioner类型。取值：`roundrobin`、`hash`、`random`。默认为：`random`。            |
| HashKeys        | String数组 | 否    | PartitionerType为`hash`时，需指定HashKeys。                                   |
| HashOnce        | bool     | 否    |                                                                        |
| ClientID        | string   | 否    | 写入 Kafka 的 Client ID，默认取值：`LogtailPlugin`（LoongCollector Go 插件模块历史命名）。 |

## 样例

采集`/home/test-log/`路径下的所有文件名匹配`*.log`规则的文件，并将采集结果发送到Kafka。

```yaml
enable: true
inputs:
  - Type: input_file
    FilePaths: 
      - /home/test-log/*.log
flushers:
  - Type: flusher_kafka
    Brokers: 
      - 192.XX.XX.1:9092
      - 192.XX.XX.2:9092
    Topic: KafkaTestTopic
```
