# Can Filebeat send to one specific partition in Kafka cluster?

**URL:** <https://discuss.elastic.co/t/can-filebeat-send-to-one-specific-partition-in-kafka-cluster/164859>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [January 18, 2019, 8:32pm UTC](https://discuss.elastic.co/t/can-filebeat-send-to-one-specific-partition-in-kafka-cluster/164859 "2019-01-18T20:32:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cchooks2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cchooks2/32/21987_2.png) [@cchooks2](https://discuss.elastic.co/u/cchooks2)\
**Post date:** [January 18, 2019, 8:32pm UTC](https://discuss.elastic.co/t/can-filebeat-send-to-one-specific-partition-in-kafka-cluster/164859/1 "2019-01-18T20:32:10Z")

</div>

Hello,

We have a scenario where we are sending data from one filbeat(6.3.2) agent to a three partition kafka(0.0.10.) topic. We are wanting filebeat to only send to one of the partitions in the kafka cluster.

I found this post where it kind of explains how to do this using the key feature in filebeat:

> [@Is it possible to specify a partition key when using filebeat to send to a Kafka topic?](https://discuss.elastic.co/t/is-it-possible-to-specify-a-partition-key-when-using-filebeat-to-send-to-a-kafka-topic/94732/2):
>
> Yes, see [key](https://www.elastic.co/guide/en/beats/filebeat/current/kafka-output.html#_key) and [partition](https://www.elastic.co/guide/en/beats/filebeat/current/kafka-output.html#_partition) settings. Note, using key is optional when using the hash partitioner. You can define a list events fields that should be used to compute the hash. Difference is, when using key, the key will be used as event key in kafka as well (it must be unique).

This is our filebeat config:

```auto
#----------------------------- Kafka output --------------------------------
output.kafka:

  # initial brokers for reading cluster metadata
  hosts: ["broker1.fmr.com:9092","broker2.fmr.com:9092","broker3.fmr.com:9092"]

  # message topic selection + partitioning
  topic: '%{[topic]}'
  client_id: my_clientid

  key: 'anodot_kafkatest'
  partition.hash:
    hash: []
    reachable_only: false

# required_acks: 1
# compression: gzip
# max_message_bytes: 1000000

```

Does the config look correct? Should we be using something else?  
Is there a way to verify that it in fact went to only one partition?

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 15, 2019, 8:32pm UTC](https://discuss.elastic.co/t/can-filebeat-send-to-one-specific-partition-in-kafka-cluster/164859/2 "2019-02-15T20:32:13Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
