# Grok an IP address and username

**URL:** <https://discuss.elastic.co/t/grok-an-ip-address-and-username/194325>\
**Category:** Logstash\
**Created:** [August 7, 2019, 8:56pm UTC](https://discuss.elastic.co/t/grok-an-ip-address-and-username/194325 "2019-08-07T20:56:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![uklipse](https://avatars.discourse-cdn.com/v4/letter/u/cdc98d/32.png) [@uklipse](https://discuss.elastic.co/u/uklipse)\
**Post date:** [August 7, 2019, 8:56pm UTC](https://discuss.elastic.co/t/grok-an-ip-address-and-username/194325/1 "2019-08-07T20:56:26Z")

</div>

Hi, I have the following text below that I'm trying to parse just the IP and username. I've tried adding all the text prior to the IP but still nothing. Even if I just put 1.1.1.1 into the Grok Debugger and %{IP} as the filter, I get nothing so I think there's something very basic I'm missing and could use some help.

Gateway user authentication succeeded. Login from:119.146.12.113, Source region: US, User name: admin, Auth type: profile, Client OS version: Microsoft Windows 10 Enterprise , 64-bit.

Thanks

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 7, 2019, 9:30pm UTC](https://discuss.elastic.co/t/grok-an-ip-address-and-username/194325/2 "2019-08-07T21:30:16Z")

</div>

Try

```
    grok {
        match => {
            "message" => [
                "%{IPV4:ip}",
                "User name: %{WORD:user},"
            ]
        }
        break_on_match => false
    }
```

---

<div class="post-metadata">

**Author:** ![uklipse](https://avatars.discourse-cdn.com/v4/letter/u/cdc98d/32.png) [@uklipse](https://discuss.elastic.co/u/uklipse)\
**Post date:** [August 8, 2019, 2:39am UTC](https://discuss.elastic.co/t/grok-an-ip-address-and-username/194325/3 "2019-08-08T02:39:01Z")

</div>

Badger to the rescue again! Thanks again!

Sorry for another question but why doesn't this work in the grok debugger site ([https://grokdebug.herokuapp.com](https://grokdebug.herokuapp.com))? I thought that was were to go to test your patterns.

---

<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 5, 2019, 2:39am UTC](https://discuss.elastic.co/t/grok-an-ip-address-and-username/194325/4 "2019-09-05T02:39:03Z")

</div>

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