# Copy Field from a new processed document to an old Document

**URL:** <https://discuss.elastic.co/t/copy-field-from-a-new-processed-document-to-an-old-document/250897>\
**Category:** Logstash\
**Created:** [October 4, 2020, 11:42am UTC](https://discuss.elastic.co/t/copy-field-from-a-new-processed-document-to-an-old-document/250897 "2020-10-04T11:42:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tensoue](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tensoue/32/76608_2.png) [@Tensoue](https://discuss.elastic.co/u/Tensoue)\
**Post date:** [October 4, 2020, 11:42am UTC](https://discuss.elastic.co/t/copy-field-from-a-new-processed-document-to-an-old-document/250897/1 "2020-10-04T11:42:49Z")

</div>

Hi all,  
I am trying to copy field from a new document received in logstash to an old one exists in the elasticsearch server.

For example:  
There are 2 events, lets call them event1 and event2

event1{name: "xyz",lastname:"abc"} - recieved in 12:00am  
event2{name: "dfs",lastname:"asdf",status:3} - recieved in 12:30am

I want to copy the status field from event2 to event2(event 1 already indexed)

I tried many options with elasticsearch output plugin but could only merge the documents.  
How can I copy only the status field?

The purpose of this is because i'm creating a transform from those events and the transform must be grouped by the "status" field.

Thanks alot for helping!

---

<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:** [November 1, 2020, 11:42am UTC](https://discuss.elastic.co/t/copy-field-from-a-new-processed-document-to-an-old-document/250897/2 "2020-11-01T11:42:53Z")

</div>

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