# All values become strings

**URL:** <https://discuss.elastic.co/t/all-values-become-strings/66176>\
**Category:** Logstash\
**Created:** [November 15, 2016, 11:10pm UTC](https://discuss.elastic.co/t/all-values-become-strings/66176 "2016-11-15T23:10:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rolfberkenbosch](https://avatars.discourse-cdn.com/v4/letter/r/5fc32e/32.png) [@rolfberkenbosch](https://discuss.elastic.co/u/rolfberkenbosch)\
**Post date:** [November 15, 2016, 11:10pm UTC](https://discuss.elastic.co/t/all-values-become-strings/66176/1 "2016-11-15T23:10:15Z")

</div>

Hi,

I have the following code, but the ruby code is not working for detecting numeric values. So all fields are strings:

input {  
tcp {  
host =\> "172.30.19.177"  
port =\> 5000  
type =\> syslog  
}  
udp {  
port =\> 5000  
type =\> syslog  
}  
}

filter {  
if [type] == "syslog" {  
mutate {  
gsub =\> [  
"message", "= ", '="" '  
]  
}  
kv {  
include\_brackets =\> false  
}  
ruby {  
code =\> "  
event.to\_hash.keys.each { |k|  
if k.start\_with?('cnt\_')  
event[k] = event[k].to\_i  
end  
}  
"  
}  
geoip {  
source =\> "dst\_ip"  
}  
}  
}

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
}  
}

---

<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 20, 2016, 4:15pm UTC](https://discuss.elastic.co/t/all-values-become-strings/66176/2 "2016-11-20T16:15:27Z")

</div>

Please show an example event that isn't processed correctly. Please show what it looks like using a `stdout { codec => rubydebug }` output.

---

<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 18, 2016, 4:15pm UTC](https://discuss.elastic.co/t/all-values-become-strings/66176/3 "2016-12-18T16:15:29Z")

</div>

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