# Error converting to IP type

**URL:** <https://discuss.elastic.co/t/error-converting-to-ip-type/31720>\
**Category:** Logstash\
**Created:** [October 6, 2015, 5:47pm UTC](https://discuss.elastic.co/t/error-converting-to-ip-type/31720 "2015-10-06T17:47:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![javi](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@javi](https://discuss.elastic.co/u/javi)\
**Post date:** [October 6, 2015, 5:47pm UTC](https://discuss.elastic.co/t/error-converting-to-ip-type/31720/1 "2015-10-06T17:47:56Z")

</div>

Hello,  
In trying to use the IP field type and in doing so I am seeing a strange error in the logstash logs.

I am running with version 1.4.5

the portion of the config that is causing the error to be thrown is as follows:  
mutate {  
convert =\> ["Bytes", "integer"]  
convert =\> ["BytesReceived", "integer"]  
convert =\> ["BytesSent", "integer"]  
convert =\> ["ElapsedTimeInSec", "integer"]  
convert =\> ["geoip.area\_code", "integer"]  
convert =\> ["geoip.dma\_code", "integer"]  
convert =\> ["geoip.latitude", "float"]  
convert =\> ["geoip.longitude", "float"]  
convert =\> ["NATDestinationPort", "integer"]  
convert =\> ["NATSourcePort", "integer"]  
convert =\> ["Packets", "integer"]  
convert =\> ["pkts\_received", "integer"]  
convert =\> ["pkts\_sent", "integer"]  
convert =\> ["seqno", "integer"]  
gsub =\> [ "Rule", " ", "_",  
"Application", "( |-)", "_" ]  
remove\_field =\> ["message", "raw\_message"]  
add\_field =\> ["clientip", "%{DestinationAddress}"]  
convert =\>["clientip","IP"]  
}

Error is:  
{:timestamp=\>"2015-10-06T12:44:04.476000-0400", :message=\>"+---------------------------------------------------------+\n| An unexpected error occurred. This is probably a bug. |\n| You can find help with this problem in a few places: |\n| |\n| \* chat: #logstash IRC channel on freenode irc. |\n| IRC via the web: [http://goo.gl/TI4Ro](http://goo.gl/TI4Ro) |\n| \* email: [logstash-users@googlegroups.com](mailto:logstash-users@googlegroups.com) |\n| \* bug system: [https://logstash.jira.com/](https://logstash.jira.com/) |\n| |\n+---------------------------------------------------------+\nThe error reported is: \n undefined local variable or method `valid\_types' for #LogStash::Filters::Mutate:0x4dcf319"}

Looking to see if anyone has seen this or has a work around?

Thanks,  
Javier

---

<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:** [October 6, 2015, 5:51pm UTC](https://discuss.elastic.co/t/error-converting-to-ip-type/31720/2 "2015-10-06T17:51:45Z")

</div>

"IP" isn't a Logstash type but an Elasticsearch type. You'll pass the IP address to ES as a string and ES will parse the IP address and store it accordingly _if_ that field is mapped as having the type "ip". This is controlled by the index template.

---

<div class="post-metadata">

**Author:** ![javi](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@javi](https://discuss.elastic.co/u/javi)\
**Post date:** [October 6, 2015, 6:24pm UTC](https://discuss.elastic.co/t/error-converting-to-ip-type/31720/3 "2015-10-06T18:24:21Z")

</div>

Thanks,  
Strange I have been passing it that way and its not working how I thought it might when I was trying to do the tile map setup. I will go back and see what else might be wrong. Thanks for the quick response.

Javier

---

<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:27am UTC](https://discuss.elastic.co/t/error-converting-to-ip-type/31720/4 "2017-07-06T05:27:17Z")

</div>


