# How to join or merge two document ID data into a single document using a common field value in both Document ID

**URL:** <https://discuss.elastic.co/t/how-to-join-or-merge-two-document-id-data-into-a-single-document-using-a-common-field-value-in-both-document-id/328515>\
**Category:** Kibana\
**Tags:** kql-kibana-query-language\
**Created:** [March 25, 2023, 10:02am UTC](https://discuss.elastic.co/t/how-to-join-or-merge-two-document-id-data-into-a-single-document-using-a-common-field-value-in-both-document-id/328515 "2023-03-25T10:02:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaurav\_kr](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@Gaurav\_kr](https://discuss.elastic.co/u/Gaurav_kr)\
**Post date:** [March 25, 2023, 10:02am UTC](https://discuss.elastic.co/t/how-to-join-or-merge-two-document-id-data-into-a-single-document-using-a-common-field-value-in-both-document-id/328515/1 "2023-03-25T10:02:23Z")

</div>

Hi All,

I am using ELK 8.0.0 version and wanted to know can we merge or join the 2 different document ID into a single data with a common field value in both the documents.

e.g  
first document ID has below data  
emp\_name : gaurav  
emp\_sex: male  
emp\_id : 22

and

second document has below data  
emp\_location : leads  
emp\_id : 22

so after the merge or join we should get a below data in a single document  
emp\_name : gaurav  
emp\_sex: male  
emp\_location : leads  
emp\_id : 22

Please suggest if we have any such features or processor we can use or any scripting, Any help/suggestion will be appreciated.

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [April 13, 2023, 1:20pm UTC](https://discuss.elastic.co/t/how-to-join-or-merge-two-document-id-data-into-a-single-document-using-a-common-field-value-in-both-document-id/328515/2 "2023-04-13T13:20:21Z")

</div>

That is exactly the purpose of the [enrich processor](https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-processor.html). Take a look at this complete guide on how to enrich documents with values from a reference index

> **[Enrich your data | Elasticsearch Guide \[8.7\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-enriching-data.html)**

---

<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:** [May 11, 2023, 1:21pm UTC](https://discuss.elastic.co/t/how-to-join-or-merge-two-document-id-data-into-a-single-document-using-a-common-field-value-in-both-document-id/328515/3 "2023-05-11T13:21:12Z")

</div>

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