# Kafka sink Connector to Elasticsearch

**URL:** https://discuss.elastic.co/t/kafka-sink-connector-to-elasticsearch/328361
**Category:** Elasticsearch
**Created:** [March 23, 2023, 3:11pm UTC](https://discuss.elastic.co/t/kafka-sink-connector-to-elasticsearch/328361 "2023-03-23T15:11:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![searchwithme](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/searchwithme/32/137075_2.png) [@searchwithme](https://discuss.elastic.co/u/searchwithme)
#### Post date: [March 23, 2023, 3:11pm UTC](https://discuss.elastic.co/t/kafka-sink-connector-to-elasticsearch/328361/1 "2023-03-23T15:11:08Z")

</div>

I am trying to set up ingestion pipeline to elasticsearch cluster via kafka sink connector. A question I have is if I have a doc that haas multiple json objects like this:

[  
{"name":"abc", "company":"123","dept":"test"},  
{"name":"def", "company":"456","dept":"dev"},  
{"name":"ghi", "company":"654","dept":"qa"},  
{"name":"jkl", "company":"567","dept":"test"},  
{"name":"mno", "company":"786","dept":"qa"}  
]

would kafka connector be able to parse each of the log line and ingest as a separate document or would it ingest the entirety of the array as one doc?

> **[Kafka Elasticsearch Connector Tutorial with Examples](https://www.confluent.io/blog/kafka-elasticsearch-connector-tutorial/)**
>
> In this tutorial, we’ll show you how to connect Kafka to Elasticsearch with minimum effort using the Elasticsearch sink connector.

The example in this just talks about one doc. So curious if a file has multiple json objects. If possible, what tweaks need to be done?

Please help!

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [March 23, 2023, 3:20pm UTC](https://discuss.elastic.co/t/kafka-sink-connector-to-elasticsearch/328361/2 "2023-03-23T15:20:15Z")

</div>

That can not be indexed into Elasticsearch as a single document so if the connector did not transform the data it would result in an error. I suspect you may need to reach out the Kafka community with questions about this.

---

<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: [April 20, 2023, 3:21pm UTC](https://discuss.elastic.co/t/kafka-sink-connector-to-elasticsearch/328361/3 "2023-04-20T15:21:12Z")

</div>

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