# \[Resolved\] Migrating from logstash 2.1 to 2.4, grok error

**URL:** <https://discuss.elastic.co/t/resolved-migrating-from-logstash-2-1-to-2-4-grok-error/59991>\
**Category:** Logstash\
**Created:** [September 7, 2016, 1:44pm UTC](https://discuss.elastic.co/t/resolved-migrating-from-logstash-2-1-to-2-4-grok-error/59991 "2016-09-07T13:44:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdesgrange](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@rdesgrange](https://discuss.elastic.co/u/rdesgrange)\
**Post date:** [September 7, 2016, 1:44pm UTC](https://discuss.elastic.co/t/resolved-migrating-from-logstash-2-1-to-2-4-grok-error/59991/1 "2016-09-07T13:44:00Z")

</div>

Hi,

I tried to migrate from logstash 2.1 to 2.4.

I have this grok rule in a file in the pattern directory :

```auto
RAILS_TIME %{YEAR}-%{MONTHNUM}-%{MONTHDAY}[T]%{HOUR}:?%{MINUTE}(?::?%{SECOND})?( %{ISO8601_TIMEZONE})?
LOGRAGE method=%{WORD:method} path=%{URIPATH:path}( format=%{DATA:format})? controller=%{DATA:controller} action=%{WORD:action} status=%{INT:status}( duration=%{NUMBER:duration})?( view=%{NUMBER:view})?( db=%{NUMBER:db})?( location=%{URI:location})?( time=%{RAILS_TIME:time})?( host=%{HOSTNAME:host})?( params=%{GREEDYDATA:params})?

```

The grok debugger said that there is an error : [https://grokdebug.herokuapp.com](https://grokdebug.herokuapp.com)

But logstash 2.1 start and work like a charm, when logstash 2.4 give me an error. I'm using the logstash docker image to test against the config file and I use volume to be sure that the file used in both 2.1 and 2.4 are the same.

In advance thanks.

---

<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:** [September 9, 2016, 7:22am UTC](https://discuss.elastic.co/t/resolved-migrating-from-logstash-2-1-to-2-4-grok-error/59991/2 "2016-09-09T07:22:34Z")

</div>

> The grok debugger said that there is an error

What is the error?

---

<div class="post-metadata">

**Author:** ![rdesgrange](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@rdesgrange](https://discuss.elastic.co/u/rdesgrange)\
**Post date:** [September 9, 2016, 8:06am UTC](https://discuss.elastic.co/t/resolved-migrating-from-logstash-2-1-to-2-4-grok-error/59991/3 "2016-09-09T08:06:20Z")

</div>

Compile error.

I manage to get it working. Don't know why but it seems that logstash 2.4 cannot accept more than 1 grok rule per grok file. So I put the RAILS\_TIME in an another file and it worked.

---

<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:** [September 9, 2016, 8:10am UTC](https://discuss.elastic.co/t/resolved-migrating-from-logstash-2-1-to-2-4-grok-error/59991/4 "2016-09-09T08:10:34Z")

</div>

> I manage to get it working. Don't know why but it seems that logstash 2.4 cannot accept more than 1 grok rule per grok file.

No, that's not true. The pattern files that ship with Logstash include dozens of patterns.

> So I put the RAILS\_TIME in an another file and it worked.

Perhaps you had a line ending issue or something?

---

<div class="post-metadata">

**Author:** ![rdesgrange](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@rdesgrange](https://discuss.elastic.co/u/rdesgrange)\
**Post date:** [September 9, 2016, 8:22am UTC](https://discuss.elastic.co/t/resolved-migrating-from-logstash-2-1-to-2-4-grok-error/59991/5 "2016-09-09T08:22:29Z")

</div>

Maybe but what bother me is that the exact same file work with 2.(1|2|3) and not 2.4... But I'll check this out. Thanks

---

<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 6, 2017, 4:39am UTC](https://discuss.elastic.co/t/resolved-migrating-from-logstash-2-1-to-2-4-grok-error/59991/6 "2017-07-06T04:39:09Z")

</div>

Closed on July 6, 2017, 4:39am UTC


