# How to convert String to interger

**URL:** https://discuss.elastic.co/t/how-to-convert-string-to-interger/107956
**Category:** Logstash
**Created:** [November 16, 2017, 2:39pm UTC](https://discuss.elastic.co/t/how-to-convert-string-to-interger/107956 "2017-11-16T14:39:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![saad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saad/32/17214_2.png) [@saad](https://discuss.elastic.co/u/saad)
#### Post date: [November 16, 2017, 2:39pm UTC](https://discuss.elastic.co/t/how-to-convert-string-to-interger/107956/1 "2017-11-16T14:39:43Z")

</div>

Hi  
The input is cef and I have two fields (bytesIn and bytesOut). I want to convert these two fields from string to numeric fields such as interger or long. I tried to do the following in mutate as shown below:  
convert =\> {"bytesIn" =\> "interger"}  
convert =\> {"bytesOut" =\> "interger"}

However, I got the fields converted from for example 7366 to 0

Thank you

---

<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: [November 16, 2017, 2:44pm UTC](https://discuss.elastic.co/t/how-to-convert-string-to-interger/107956/2 "2017-11-16T14:44:40Z")

</div>

You've misspellt "integer".

---

<div class="post-metadata">

### Author: ![saad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saad/32/17214_2.png) [@saad](https://discuss.elastic.co/u/saad)
#### Post date: [November 16, 2017, 2:55pm UTC](https://discuss.elastic.co/t/how-to-convert-string-to-interger/107956/3 "2017-11-16T14:55:15Z")

</div>

thank you

---

<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: [December 14, 2017, 2:55pm UTC](https://discuss.elastic.co/t/how-to-convert-string-to-interger/107956/4 "2017-12-14T14:55:30Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
