# Why \_grokparsefailer doesn't give specific error

**URL:** https://discuss.elastic.co/t/why-grokparsefailer-doesnt-give-specific-error/124462
**Category:** Logstash
**Created:** [March 18, 2018, 9:21pm UTC](https://discuss.elastic.co/t/why-grokparsefailer-doesnt-give-specific-error/124462 "2018-03-18T21:21:22Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jason\_smith](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jason\_smith](https://discuss.elastic.co/u/jason_smith)
#### Post date: [March 18, 2018, 9:21pm UTC](https://discuss.elastic.co/t/why-grokparsefailer-doesnt-give-specific-error/124462/1 "2018-03-18T21:21:22Z")

</div>

Hello Good folks,

when we have grokparseerror, how can I understand where the error is generated while parsing?  
I just tried to grab the first two fields from the file using the following grok filter. It threw error without actually giving details.

```
   	grok{
		match=>["message",'\[%{HTTPDATE:timestamp}\] %{WORD:efw}']
}	

```

The file I am reading.

```
[2017-03-03 16:06:02] EFW: TCP_FLAG: prio=2 id=03300004 rev=1 event=tcp_flag_set action=strip_flag bad_flag=ECN rule=TCPECN recvif=interface srcip=10.1.1.1 destip=10.3.0.1 ipdf=1 ipproto=TCP ipdatalen=32 srcport=13111 destport=80 tcphdrlen=32 syn=1 ece=1 cwr=1

```

Logstash error:  
 ![2018-03-18_14-22-41](https://us1.discourse-cdn.com/elastic/original/3X/8/f/8f611f0ec076532c982cc52f997e4b060d2db081.jpg)

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [March 18, 2018, 9:30pm UTC](https://discuss.elastic.co/t/why-grokparsefailer-doesnt-give-specific-error/124462/2 "2018-03-18T21:30:00Z")

</div>

Regular expression matchers typically don't provide details about what part of the expression matched and what part didn't.

The key is to build your expressions gradually. Start with the very simplest you can. When that works, move on by adding more to the end of your expression. Continue until you're done or until it stops matching.

In this particular case the problem is that you're using HTTPDATE. Its definition looks like this:

> <https://github.com/logstash-plugins/logstash-patterns-core/blob/v4.1.2/patterns/grok-patterns#L86>

Clearly, this doesn't match the timestamp you have. Try TIMESTAMP\_ISO8601 instead.

Have you tried using the grok constructor web site?

---

<div class="post-metadata">

### Author: ![jason\_smith](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jason\_smith](https://discuss.elastic.co/u/jason_smith)
#### Post date: [March 18, 2018, 9:33pm UTC](https://discuss.elastic.co/t/why-grokparsefailer-doesnt-give-specific-error/124462/3 "2018-03-18T21:33:29Z")

</div>

> [@magnusbaeck](#):
>
> TIMESTAMP\_ISO8601

That worked Magnusbaeck. Thank You

---

<div class="post-metadata">

### Author: ![jason\_smith](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jason\_smith](https://discuss.elastic.co/u/jason_smith)
#### Post date: [March 18, 2018, 9:47pm UTC](https://discuss.elastic.co/t/why-grokparsefailer-doesnt-give-specific-error/124462/4 "2018-03-18T21:47:20Z")

</div>

Can you suggest me any site/links that have samples with grok filters? I googled. I found some blogs but not good samples in them.

thank you

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [March 19, 2018, 7:15am UTC](https://discuss.elastic.co/t/why-grokparsefailer-doesnt-give-specific-error/124462/5 "2018-03-19T07:15:34Z")

</div>

Grok is just a convenience layer on top of regular expressions, and regular expressions are explained in many places. If you understand regular expressions then you'll understand grok in no time.

---

<div class="post-metadata">

### Author: ![jason\_smith](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jason\_smith](https://discuss.elastic.co/u/jason_smith)
#### Post date: [March 19, 2018, 4:07pm UTC](https://discuss.elastic.co/t/why-grokparsefailer-doesnt-give-specific-error/124462/6 "2018-03-19T16:07:45Z")

</div>

Thank You

---

<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: [April 16, 2018, 4:08pm UTC](https://discuss.elastic.co/t/why-grokparsefailer-doesnt-give-specific-error/124462/7 "2018-04-16T16:08:07Z")

</div>

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