# Working with child fields

**URL:** <https://discuss.elastic.co/t/working-with-child-fields/50353>\
**Category:** Logstash\
**Created:** [May 18, 2016, 3:16pm UTC](https://discuss.elastic.co/t/working-with-child-fields/50353 "2016-05-18T15:16:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronwest99](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@ronwest99](https://discuss.elastic.co/u/ronwest99)\
**Post date:** [May 18, 2016, 3:16pm UTC](https://discuss.elastic.co/t/working-with-child-fields/50353/1 "2016-05-18T15:16:52Z")

</div>

My log looks something like this.  
"request": {  
"hostip": "10.7.37.74",  
"enduserip": "",  
}

Obviously "enduserip": "" is not a valid IP address. I would like to delete the field in this case.

This syntax isn't being considered valid by logstash.  
mutate{  
remove\_field =\> ["request"]["enduserip"]  
}

Any suggestions?

---

<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:** [May 18, 2016, 8:40pm UTC](https://discuss.elastic.co/t/working-with-child-fields/50353/2 "2016-05-18T20:40:28Z")

</div>

```nohighlight
mutate {
  remove_field => ["[request][enduserip]"]
}

```

---

<div class="post-metadata">

**Author:** ![ronwest99](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@ronwest99](https://discuss.elastic.co/u/ronwest99)\
**Post date:** [May 18, 2016, 10:06pm UTC](https://discuss.elastic.co/t/working-with-child-fields/50353/3 "2016-05-18T22:06:16Z")

</div>

That worked, thanks!

Does the same syntax hold true for renaming a child field?

(my google foo on these topic's is highly lacking)

---

<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:** [May 19, 2016, 5:35am UTC](https://discuss.elastic.co/t/working-with-child-fields/50353/4 "2016-05-19T05:35:56Z")

</div>

Yes.

[https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references)

---

<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:** [July 6, 2017, 4:57am UTC](https://discuss.elastic.co/t/working-with-child-fields/50353/5 "2017-07-06T04:57:01Z")

</div>


