# How to use the second level of a fields

**URL:** <https://discuss.elastic.co/t/how-to-use-the-second-level-of-a-fields/60035>\
**Category:** Logstash\
**Created:** [September 8, 2016, 4:14am UTC](https://discuss.elastic.co/t/how-to-use-the-second-level-of-a-fields/60035 "2016-09-08T04:14:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![WangXiangUSTC](https://avatars.discourse-cdn.com/v4/letter/w/8dc957/32.png) [@WangXiangUSTC](https://discuss.elastic.co/u/WangXiangUSTC)\
**Post date:** [September 8, 2016, 4:14am UTC](https://discuss.elastic.co/t/how-to-use-the-second-level-of-a-fields/60035/1 "2016-09-08T04:14:02Z")

</div>

I add a new field "fields.ip "in filebeat's configure file, it look like below：

filebeat:  
prospectors:

- input\_type: log  
paths:
  - /home/vagarnt/log/\*  
fields:  
ip: 192.168.33.11  
type: formal  
encoding: plain

And the filebeat send data to logstash.  
So, the logstash can get the IP information of where the data come from.  
I know I can use [fields][ip] to get the ip information, but how to use it in mutate:  
for example:  
mutate {  
remove\_field =\> ["timestamp", "beat", "input\_type", "type", "host", "@version"]  
}  
I want to remove fields.type, but save the fields.ip, how should I do?

below dosen't work:  
remove\_field =\> ["timestamp", "beat", "input\_type", "type", "host", "@version", "fields.type"]

---

<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:** [September 8, 2016, 5:34am UTC](https://discuss.elastic.co/t/how-to-use-the-second-level-of-a-fields/60035/2 "2016-09-08T05:34:39Z")

</div>

> I want to remove fields.type, but save the fields.ip, how should I do?

> below dosen't work:  
> remove\_field =\> ["timestamp", "beat", "input\_type", "type", "host", "@version", "fields.type"]

`[fields][type]`, not `fields.type`.

---

<div class="post-metadata">

**Author:** ![WangXiangUSTC](https://avatars.discourse-cdn.com/v4/letter/w/8dc957/32.png) [@WangXiangUSTC](https://discuss.elastic.co/u/WangXiangUSTC)\
**Post date:** [September 8, 2016, 10:31am UTC](https://discuss.elastic.co/t/how-to-use-the-second-level-of-a-fields/60035/3 "2016-09-08T10:31:25Z")

</div>

Ok, thanks for your reply.

---

<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:39am UTC](https://discuss.elastic.co/t/how-to-use-the-second-level-of-a-fields/60035/4 "2017-07-06T04:39:18Z")

</div>


