# Elastic - Logstash: Copy data from one field to another field within same index - both the fields are nested

**URL:** <https://discuss.elastic.co/t/elastic-logstash-copy-data-from-one-field-to-another-field-within-same-index-both-the-fields-are-nested/269529>\
**Category:** Logstash\
**Created:** [April 7, 2021, 9:49pm UTC](https://discuss.elastic.co/t/elastic-logstash-copy-data-from-one-field-to-another-field-within-same-index-both-the-fields-are-nested/269529 "2021-04-07T21:49:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Siri2](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@Siri2](https://discuss.elastic.co/u/Siri2)\
**Post date:** [April 7, 2021, 9:49pm UTC](https://discuss.elastic.co/t/elastic-logstash-copy-data-from-one-field-to-another-field-within-same-index-both-the-fields-are-nested/269529/1 "2021-04-07T21:49:10Z")

</div>

Hi, I am trying to copy data from one field to another field within the same index using filter -\> mutate -\> copy

I want to mention that both the fields are nested.

When I run the script it doesn't show me if it copied data to the new field or not?

Could someone please help me with it?

Below is my logstash script which I am currently working with.

```auto

input {
	elasticsearch {
		hosts =>
		user => 
		password => 
		index => 
		ssl =>
		#size => 1
		docinfo =>
		#docinfo_fields =>
		ca_file =>
		query => '{
				"_source": ["allbirds_metadata.resumeLink","allbirds_metadata.resumeLastUpdatedDate"],
	 			"query": {
							"bool": {
							"must": [{
			  				"exists": {
							"field": "allbirds_metadata.resumeLink"
										}			
								},
							{
							"exists": {
								"field": "allbirds_metadata.resumeLastUpdatedDate"
									}
							}
					]		
				}
			}
		}'
	}
}

filter {
     mutate {
	copy => {"allbirds_metadata.resumeLink"=> "allbirds_metadata.attachments.path" }
        copy => { "allbirds_metadata.resumeLastUpdatedDate" => "allbirds_metadata.attachments.upload_time" }
    }
}
output {
 stdout {codec => rubydebug { metadata => true } }
}

```

---

<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 5, 2021, 9:49pm UTC](https://discuss.elastic.co/t/elastic-logstash-copy-data-from-one-field-to-another-field-within-same-index-both-the-fields-are-nested/269529/2 "2021-05-05T21:49:49Z")

</div>

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