# Removes ::ffff: from ip address field

**URL:** <https://discuss.elastic.co/t/removes-from-ip-address-field/166706>\
**Category:** Logstash\
**Created:** [February 1, 2019, 9:59am UTC](https://discuss.elastic.co/t/removes-from-ip-address-field/166706 "2019-02-01T09:59:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thibaut603](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@Thibaut603](https://discuss.elastic.co/u/Thibaut603)\
**Post date:** [February 1, 2019, 9:59am UTC](https://discuss.elastic.co/t/removes-from-ip-address-field/166706/1 "2019-02-01T09:59:51Z")

</div>

Hello,

i want to remove ::ffff: from ip address field (like this)  
 ![ip](https://us1.discourse-cdn.com/elastic/original/3X/c/4/c4bc6df0a20d2bd4f9adae614e1efd552d8c6202.png)

so in logstash i've made this

```
# Removes ::ffff from IP address
filter {
  if "winlogbeat" in [tags] {
  mutate {
    gsub => ["[event_data][IpAddress]", "::ffff:", ""]
         }
                            }
        }

```

but that does not work, any ideas ?

Thx for help

Thibaut,

---

<div class="post-metadata">

**Author:** ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)\
**Post date:** [February 1, 2019, 10:03am UTC](https://discuss.elastic.co/t/removes-from-ip-address-field/166706/2 "2019-02-01T10:03:36Z")

</div>

I think you need to change:

```auto
[event_data][IpAddress]

```

To this:

```auto
%{[event_data][IpAddress]}

```

---

<div class="post-metadata">

**Author:** ![Thibaut603](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@Thibaut603](https://discuss.elastic.co/u/Thibaut603)\
**Post date:** [February 1, 2019, 11:46am UTC](https://discuss.elastic.co/t/removes-from-ip-address-field/166706/3 "2019-02-01T11:46:29Z")

</div>

i've changed and it's really strange sometimes i've ::ffff: and somitimes not

```
February 1st 2019, 12:42:33.724 ::ffff:10.100.25.108

February 1st 2019, 12:42:33.471 10.100.247.131

```

i think the filter doen't removes ::ffff; and certain event don't have this ffff.

it's possible ?

---

<div class="post-metadata">

**Author:** ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)\
**Post date:** [February 1, 2019, 1:09pm UTC](https://discuss.elastic.co/t/removes-from-ip-address-field/166706/4 "2019-02-01T13:09:51Z")

</div>

The addresses with ::ffff: are mapped ipv6 addresses.

have read [here](https://serverfault.com/questions/525720/does-linux-support-ipv4-mapped-ipv6-addresses)

---

<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:** [March 1, 2019, 1:09pm UTC](https://discuss.elastic.co/t/removes-from-ip-address-field/166706/5 "2019-03-01T13:09:54Z")

</div>

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