# Xml filter plugin - creating nested field out of null object: Can't get text on a END\_OBJECT

**URL:** https://discuss.elastic.co/t/xml-filter-plugin-creating-nested-field-out-of-null-object-cant-get-text-on-a-end-object/56928
**Category:** Logstash
**Created:** [August 1, 2016, 8:40pm UTC](https://discuss.elastic.co/t/xml-filter-plugin-creating-nested-field-out-of-null-object-cant-get-text-on-a-end-object/56928 "2016-08-01T20:40:50Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![whyapenny](https://avatars.discourse-cdn.com/v4/letter/w/90db22/32.png) [@whyapenny](https://discuss.elastic.co/u/whyapenny)
#### Post date: [August 4, 2016, 3:40pm UTC](https://discuss.elastic.co/t/xml-filter-plugin-creating-nested-field-out-of-null-object-cant-get-text-on-a-end-object/56928/10 "2016-08-04T15:40:32Z")

</div>

Ok, so looks like I can remove completely and it resolves the issue. I guess im still curious how/why it gets pulled in as a nested field instead of empty string.

Finally, my last question is how would i remove that field ONLY when it is empty? Since it isn't an empty string field and instead an empty nested field the following hasn't worked:  
this one fails to fulfill condition:

```auto
if "" in [entry][ApplId]{
	mutate { 
		remove_field => ["[entry][ApplId]" ] 
	}
}
```

this one actuates EVERY time:

```auto
if [entry][ApplId][]{
    mutate { 
        remove_field => ["[entry][ApplId]" ] 
    }
}
```

so is there a way i can write a condition which will remove the field only when it is empty, and not all or nothing? When there is information presented in ApplId i would prefer to keep that field.

---

_[View the full topic](https://discuss.elastic.co/t/xml-filter-plugin-creating-nested-field-out-of-null-object-cant-get-text-on-a-end-object/56928)._
