# \_grokparsefailure while creating field using grok filter

**URL:** <https://discuss.elastic.co/t/grokparsefailure-while-creating-field-using-grok-filter/204729>\
**Category:** Logstash\
**Created:** [October 22, 2019, 8:30pm UTC](https://discuss.elastic.co/t/grokparsefailure-while-creating-field-using-grok-filter/204729 "2019-10-22T20:30:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vishal\_Sharma4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_sharma4/32/56359_2.png) [@Vishal\_Sharma4](https://discuss.elastic.co/u/Vishal_Sharma4)\
**Post date:** [October 22, 2019, 8:30pm UTC](https://discuss.elastic.co/t/grokparsefailure-while-creating-field-using-grok-filter/204729/1 "2019-10-22T20:30:58Z")

</div>

Hi ,  
I am new on logstash , I have created grok pattern for below mentioned tomcat access logs.  
10.0.6.35 - - [21/Oct/2019:00:00:21 +0000] "GET /rest/V1/productlist/category/4/ar/18/20 HTTP/1.1" 200 15917 25  
My logstash conf file is:

input { beats {  
port =\> 5044  
}  
}

filter  
{  
grok  
{  
match =\> ["message","%{IP:clientip} - - [%{HTTPDATE:times}] "%{WORD:action} /%{GREEDYDATA:api} %{WORD:protocol}/%{NUMBER:protocolNum}" %{NUMBER:status} %{NUMBER:bytes} %{NUMBER:duration}" ]

}  
date {  
match =\> ["timestamp" , "dd/MMM/yyyy:HH:mm:ss Z"]  
}  
}  
elasticsearch {  
stdout { codec =\> rubydebug }  
hosts =\> ["172.31.30.73:9200"]  
index =\> "logstash-%{+YYYY.MM.dd}"

}

when i start the logstash its shows \_grokparsefailure and no field are creating in kibana,I want that duration ,status etc. field on kibana .

Please help me ASAP  
Thanks in advanced  
Vishal sharma

---

<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:** [October 22, 2019, 9:42pm UTC](https://discuss.elastic.co/t/grokparsefailure-while-creating-field-using-grok-filter/204729/2 "2019-10-22T21:42:49Z")

</div>

Are you escaping the square brackets in the pattern?

```
grok { match => ["message","%{IP:clientip} - - \[%{HTTPDATE:times}\] \"%{WORD:action} /%{GREEDYDATA:api} %{WORD:protocol}/%{NUMBER:protocolNum}\" %{NUMBER:status} %{NUMBER:bytes} %{NUMBER:duration}" ] }
```

---

<div class="post-metadata">

**Author:** ![Vishal\_Sharma4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_sharma4/32/56359_2.png) [@Vishal\_Sharma4](https://discuss.elastic.co/u/Vishal_Sharma4)\
**Post date:** [October 23, 2019, 5:36am UTC](https://discuss.elastic.co/t/grokparsefailure-while-creating-field-using-grok-filter/204729/3 "2019-10-23T05:36:38Z")

</div>

Yes I am removing square brackets from the pattern.  
Please tell me exactly what I am doing wrong.

---

<div class="post-metadata">

**Author:** ![Vishal\_Sharma4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_sharma4/32/56359_2.png) [@Vishal\_Sharma4](https://discuss.elastic.co/u/Vishal_Sharma4)\
**Post date:** [October 23, 2019, 5:40am UTC](https://discuss.elastic.co/t/grokparsefailure-while-creating-field-using-grok-filter/204729/4 "2019-10-23T05:40:19Z")

</div>

I have changed my grok pattern still getting same error.  
match =\> { "message"=\>"%{IP:clientip} - - [%{NOTSPACE:date} +%{INT}] "%{WORD:action} /%{GREEDYDATA:api} %{WORD:protocol}/%{NUMBER:protocolNum}" %{NUMBER:status} %{NUMBER}"}

---

<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:** [October 23, 2019, 12:29pm UTC](https://discuss.elastic.co/t/grokparsefailure-while-creating-field-using-grok-filter/204729/5 "2019-10-23T12:29:31Z")

</div>

> [@Vishal\_Sharma4](#):
>
> Please tell me exactly what I am doing wrong.

I do not know. When I use the grok filter that I posted it successfully parses the line you posted.

---

<div class="post-metadata">

**Author:** ![Vishal\_Sharma4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishal_sharma4/32/56359_2.png) [@Vishal\_Sharma4](https://discuss.elastic.co/u/Vishal_Sharma4)\
**Post date:** [October 23, 2019, 12:39pm UTC](https://discuss.elastic.co/t/grokparsefailure-while-creating-field-using-grok-filter/204729/6 "2019-10-23T12:39:19Z")

</div>

> [@Badger](#):
>
> ```auto
> 
> ```

ok thanks got the solution

---

<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:** [November 20, 2019, 12:39pm UTC](https://discuss.elastic.co/t/grokparsefailure-while-creating-field-using-grok-filter/204729/7 "2019-11-20T12:39:24Z")

</div>

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