# Convert String to IP

**URL:** https://discuss.elastic.co/t/convert-string-to-ip/51527
**Category:** Logstash
**Created:** [June 1, 2016, 8:37am UTC](https://discuss.elastic.co/t/convert-string-to-ip/51527 "2016-06-01T08:37:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Kennedy\_Kan1](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Kennedy\_Kan1](https://discuss.elastic.co/u/Kennedy_Kan1)
#### Post date: [June 1, 2016, 8:37am UTC](https://discuss.elastic.co/t/convert-string-to-ip/51527/1 "2016-06-01T08:37:39Z")

</div>

I have started up packetbeat to send data to logstash and here is part of the logs

```
     "answers" => [
        [0] {
            "class" => "IN",
             "data" => "clients.l.google.com",
             "name" => "clients1.google.com",
              "ttl" => 47,
             "type" => "CNAME"
        },
        [1] {
            "class" => "IN",
             "data" => "216.58.199.14",
             "name" => "clients.l.google.com",
              "ttl" => 186,
             "type" => "A"
        }
    ],

```

and the data shown as ip is displayed as string and I want to convert it into an IP so I can map it with tiles map in kibana.

Is there anyway to do that?

---

<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 2, 2016, 12:54am UTC](https://discuss.elastic.co/t/convert-string-to-ip/51527/2 "2016-06-02T00:54:06Z")

</div>

Please don't post multiple threads on the same question - [Turn Packetbeat IP data from String to IP field type](https://discuss.elastic.co/t/turn-packetbeat-ip-data-from-string-to-ip-field-type/51546/5)

---

<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 2, 2016, 12:54am UTC](https://discuss.elastic.co/t/convert-string-to-ip/51527/3 "2016-06-02T00:54:09Z")

</div>


