# Replace Field Values - Type Conversion

**URL:** https://discuss.elastic.co/t/replace-field-values-type-conversion/29659
**Category:** Logstash
**Created:** [September 20, 2015, 3:10pm UTC](https://discuss.elastic.co/t/replace-field-values-type-conversion/29659 "2015-09-20T15:10:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![coderlol](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@coderlol](https://discuss.elastic.co/u/coderlol)
#### Post date: [September 20, 2015, 3:10pm UTC](https://discuss.elastic.co/t/replace-field-values-type-conversion/29659/1 "2015-09-20T15:10:01Z")

</div>

Considering this event:

{"@version":"1","@timestamp":"2015-09-20T06:45:03.613Z","contextMap":{"sourceline":"500"},"source":{"class":"myClass","method":"myMethod","file":"myFile.java","line":100}}

[source][line] is an integer  
[contextMap][sourceline] is a string

Given this mutate filter:  
mutate {  
replace =\> { "[source][line]" =\> "%{[contextMap][sourceline]}" }  
}

Would the [contextMap][sourceline] value be converted to an integer automatically?

Thanks...

---

<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 20, 2015, 3:20pm UTC](https://discuss.elastic.co/t/replace-field-values-type-conversion/29659/2 "2015-09-20T15:20:30Z")

</div>

No. A field doesn't have a data type of its own. If you assign a string value to a field then it'll be a string after the assignment too. Same with integers.

---

<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, 5:28am UTC](https://discuss.elastic.co/t/replace-field-values-type-conversion/29659/3 "2017-07-06T05:28:36Z")

</div>


