# Substring logstash

**URL:** https://discuss.elastic.co/t/substring-logstash/304710
**Category:** Logstash
**Created:** [May 13, 2022, 6:50pm UTC](https://discuss.elastic.co/t/substring-logstash/304710 "2022-05-13T18:50:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mvasqueznr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvasqueznr/32/102515_2.png) [@mvasqueznr](https://discuss.elastic.co/u/mvasqueznr)
#### Post date: [May 13, 2022, 6:50pm UTC](https://discuss.elastic.co/t/substring-logstash/304710/1 "2022-05-13T18:50:47Z")

</div>

Hi.

Im use grok patterns to extract info from Palo Alto log. But im try to extract a substring on description field like this

> authenticated for user 'newUser'. auth profile 'D', server profile 'LTY', server address '', From: 179.213.123.244.

I want to extract the value next to user, between '' and the IP next to "From" but I dont have idea the correct form.

Any idea?

Thks

---

<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: [May 13, 2022, 6:53pm UTC](https://discuss.elastic.co/t/substring-logstash/304710/2 "2022-05-13T18:53:52Z")

</div>

I would try

```
grok {
    break_on_match => false
    match => {
        "[message]" => [
            "%{IPV4:ipAddress}",
            "user '%{USER:username}'"
        ]
    }
}
```

---

<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: [June 10, 2022, 6:54pm UTC](https://discuss.elastic.co/t/substring-logstash/304710/3 "2022-06-10T18:54:23Z")

</div>

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