# Index mappings - IP type also parses port?

**URL:** <https://discuss.elastic.co/t/index-mappings-ip-type-also-parses-port/195993>\
**Category:** Elasticsearch\
**Created:** [August 20, 2019, 7:46pm UTC](https://discuss.elastic.co/t/index-mappings-ip-type-also-parses-port/195993 "2019-08-20T19:46:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alonchis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alonchis/32/52655_2.png) [@alonchis](https://discuss.elastic.co/u/alonchis)\
**Post date:** [August 20, 2019, 7:46pm UTC](https://discuss.elastic.co/t/index-mappings-ip-type-also-parses-port/195993/1 "2019-08-20T19:46:27Z")

</div>

Hi people,

I been slowly trying to change my mappings from text to "ip". However, some logs include the port. Before i go on and modify the grok filters, I wonder if this data type can handle IP:PORT fields.

Thanks for your time.

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [August 21, 2019, 2:59am UTC](https://discuss.elastic.co/t/index-mappings-ip-type-also-parses-port/195993/2 "2019-08-21T02:59:25Z")

</div>

No, `ip` type only supports IP values. If you need the port you need to parse it and store in a different field before indexing.

---

<div class="post-metadata">

**Author:** ![alonchis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alonchis/32/52655_2.png) [@alonchis](https://discuss.elastic.co/u/alonchis)\
**Post date:** [August 21, 2019, 2:22pm UTC](https://discuss.elastic.co/t/index-mappings-ip-type-also-parses-port/195993/3 "2019-08-21T14:22:39Z")

</div>

got it. their documentation for the ip mapping didnt mention anything but wanted to be sure. Thanks for your reply Thiago

---

<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:** [September 18, 2019, 2:23pm UTC](https://discuss.elastic.co/t/index-mappings-ip-type-also-parses-port/195993/4 "2019-09-18T14:23:28Z")

</div>

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