# Converting string field to integer

**URL:** https://discuss.elastic.co/t/converting-string-field-to-integer/53853
**Category:** Logstash
**Created:** [June 24, 2016, 6:15am UTC](https://discuss.elastic.co/t/converting-string-field-to-integer/53853 "2016-06-24T06:15:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Gaurav\_SK](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@Gaurav\_SK](https://discuss.elastic.co/u/Gaurav_SK)
#### Post date: [June 24, 2016, 6:15am UTC](https://discuss.elastic.co/t/converting-string-field-to-integer/53853/1 "2016-06-24T06:15:46Z")

</div>

I am getting the value of a field name "fcs" through pattern but i want this to be in integer format, but when i open settings in kibana, it says this field has string type. Can anyone tell how to resolve this issue ?

Pattern =\>  
%{DATA}fcs-errors-stat%{DATA}%{SPACE}uint64\_value: %{NUMBER:fcs:int}

my input =\>  
fields {  
name: "fcs-errors-stat"  
fields {  
name: "data"  
uint64\_value: 0  
}

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [June 25, 2016, 8:50pm UTC](https://discuss.elastic.co/t/converting-string-field-to-integer/53853/2 "2016-06-25T20:50:45Z")

</div>

Check the mapping of the field in ES, you may either need to use a mutate + convert to be sure, or map the field in ES with a template.

---

<div class="post-metadata">

### Author: ![Gaurav\_SK](https://avatars.discourse-cdn.com/v4/letter/g/b9bd4f/32.png) [@Gaurav\_SK](https://discuss.elastic.co/u/Gaurav_SK)
#### Post date: [June 27, 2016, 11:12am UTC](https://discuss.elastic.co/t/converting-string-field-to-integer/53853/3 "2016-06-27T11:12:11Z")

</div>

Thanks, I actually need to create another new index. It couldn't update type for previous indexes.

---

<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:50am UTC](https://discuss.elastic.co/t/converting-string-field-to-integer/53853/4 "2017-07-06T04:50:48Z")

</div>


