# How to change sub field type in logstash

**URL:** <https://discuss.elastic.co/t/how-to-change-sub-field-type-in-logstash/61836>\
**Category:** Logstash\
**Created:** [September 29, 2016, 5:15pm UTC](https://discuss.elastic.co/t/how-to-change-sub-field-type-in-logstash/61836 "2016-09-29T17:15:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikanth\_ramineni](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@srikanth\_ramineni](https://discuss.elastic.co/u/srikanth_ramineni)\
**Post date:** [September 29, 2016, 5:15pm UTC](https://discuss.elastic.co/t/how-to-change-sub-field-type-in-logstash/61836/1 "2016-09-29T17:15:59Z")

</div>

Hi,

I have one property is coming from filebeat.

fields{  
properties{  
ID:String  
}  
}  
i am trying to change the ID field to integer but it is giving error.  
I tried mutate with [fields.ID](http://fields.ID) and "[fields][ID]" but the data type is not changing.  
Can someone please proivde inputs on this.

---

<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 29, 2016, 7:19pm UTC](https://discuss.elastic.co/t/how-to-change-sub-field-type-in-logstash/61836/2 "2016-09-29T19:19:19Z")

</div>

Which version of Logstash? This might only work in 2.4 and later.

---

<div class="post-metadata">

**Author:** ![srikanth\_ramineni](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@srikanth\_ramineni](https://discuss.elastic.co/u/srikanth_ramineni)\
**Post date:** [September 29, 2016, 7:43pm UTC](https://discuss.elastic.co/t/how-to-change-sub-field-type-in-logstash/61836/3 "2016-09-29T19:43:34Z")

</div>

Thanks for your reply.We are using 2.3.4 version. Could you please post the syntax for it.

---

<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 29, 2016, 8:26pm UTC](https://discuss.elastic.co/t/how-to-change-sub-field-type-in-logstash/61836/4 "2016-09-29T20:26:48Z")

</div>

I suggest using the `[fields][ID]` notation with Logstash 2.4.

---

<div class="post-metadata">

**Author:** ![srikanth\_ramineni](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@srikanth\_ramineni](https://discuss.elastic.co/u/srikanth_ramineni)\
**Post date:** [September 29, 2016, 8:55pm UTC](https://discuss.elastic.co/t/how-to-change-sub-field-type-in-logstash/61836/5 "2016-09-29T20:55:33Z")

</div>

Thanks for your quick response..

---

<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:36am UTC](https://discuss.elastic.co/t/how-to-change-sub-field-type-in-logstash/61836/6 "2017-07-06T04:36:21Z")

</div>


