# Grok pattern problem

**URL:** <https://discuss.elastic.co/t/grok-pattern-problem/184908>\
**Category:** Logstash\
**Created:** [June 10, 2019, 3:48am UTC](https://discuss.elastic.co/t/grok-pattern-problem/184908 "2019-06-10T03:48:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmk1995](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@mmk1995](https://discuss.elastic.co/u/mmk1995)\
**Post date:** [June 10, 2019, 3:48am UTC](https://discuss.elastic.co/t/grok-pattern-problem/184908/1 "2019-06-10T03:48:22Z")

</div>

Hi all,

I am facing a log pattern like this

[xxxxx.com](https://xxxxx.com/xxxxx/servlet/xxxx) on 2017-5-15 16:38:18 from 142.xx.xx.xx

And I tried to use grok like this:

> grok {  
> match =\> { "message" =\> [  
> "Timestamp: %{DATESTAMP:timestamp}",  
> "IP: %{IP:ip}",  
> "URI: %{URI:uri}"  
> ]  
> }  
> or  
> "%{URI:uri} on %{DATESTAMP:timestamp} from %{IP:ip}"

Why both are not working? Thank you in advance.

---

<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:** [June 10, 2019, 4:39pm UTC](https://discuss.elastic.co/t/grok-pattern-problem/184908/2 "2019-06-10T16:39:24Z")

</div>

DATESTAMP is not designed to consume YYYY-MM-dd, so it matches 17-5-15. This will match

```
"^%{URI:uri} on 20%{DATESTAMP:timestamp} from %{IP:ip}"

```

I would expect this to work, but it only matches the first pattern in the array. I am unable to understand that.

```
    grok {
        match => {
            break_on_match => false
            "message" => [
                "%{URI:uri}",
                "%{IP:ip}",
                "%{DATESTAMP:timestamp}"
            ]
        }
    }
```

---

<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:** [July 8, 2019, 4:39pm UTC](https://discuss.elastic.co/t/grok-pattern-problem/184908/3 "2019-07-08T16:39:29Z")

</div>

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