# Remove field from logstash configuration

**URL:** <https://discuss.elastic.co/t/remove-field-from-logstash-configuration/77507>\
**Category:** Logstash\
**Created:** [March 6, 2017, 1:46pm UTC](https://discuss.elastic.co/t/remove-field-from-logstash-configuration/77507 "2017-03-06T13:46:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinodMS](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinodms/32/13476_2.png) [@vinodMS](https://discuss.elastic.co/u/vinodMS)\
**Post date:** [March 6, 2017, 1:46pm UTC](https://discuss.elastic.co/t/remove-field-from-logstash-configuration/77507/1 "2017-03-06T13:46:39Z")

</div>

My indices are using the parent-child relationship, therefore my sql query returns parent ID that I use in the logstash configuration to use as the parent ID. Here is my logstash configuration,

```
output {
  elasticsearch {
    hosts => "https://xxx.us-east-1.es.amazonaws.com" 
	document_type => "segment"
	document_id => "%{id}"
	index => "${LANG_INDEX:en-us_th-th}"
	parent => "%{upload_id}"
    ssl => "true"
    manage_template => false
  }
}

```

The issue I have is that currently the parent ID is getting indexed in the child document, which I don't need. If I remove the field in logstash [[mutate](https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-remove_field)] then the parent field is not able to get the parent ID field.

How do I avoid elasticsearch from indexing this field?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 6, 2017, 1:58pm UTC](https://discuss.elastic.co/t/remove-field-from-logstash-configuration/77507/2 "2017-03-06T13:58:00Z")

</div>

If you make `upload_id` a subfield of `@metadata` (i.e. use the mutate filter's rename option to rename `upload_id` to `[@metadata][upload_id]`) the field won't get included in the document sent to ES but you'll still be able to reference the field in the `parent` option).

---

<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 3, 2017, 1:58pm UTC](https://discuss.elastic.co/t/remove-field-from-logstash-configuration/77507/3 "2017-04-03T13:58:37Z")

</div>

Closed on April 3, 2017, 1:58pm UTC

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