Grok fails to parse single digit patterns when used as part of other patterns

Bug #1187580 reported by greg wegman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grok
Invalid
Undecided
Unassigned

Bug Description

I've run into a bug when using grok for dates. I'm not sure how to work around it, but it keeps resulting in _grokparsefailure.

Pattern for Date:

****************************************************************
* Essentially MONTHDAY is what breaks the Pattern, I've also tried other patterns but nothing works
* ([1-9]|0[1-9]|[12][0-9]|3[01])... even [1-9] alone results in failure
****************************************************************
MONTHDAY (?:(?:0[1-9])|(?:[12][0-9])|(?:3[01])|[1-9])

TOMCATDATE %{MONTH} %{MONTHDAY}, %{YEAR} %{HOUR}:%{MINUTE}:%{SECOND}(AM|PM)

Sample Input:
1) Jun 4, 2013 12:25:33 AM org.apache.catalina.core.ApplicationContext log 1
2) Jun 14, 2013 12:25:33 AM org.apache.catalina.core.ApplicationContext log 2
3) June 4, 2013 12:25:33 AM org.apache.catalina.core.ApplicationContext log 3
4) June 04, 2013 12:25:33 AM org.apache.catalina.core.ApplicationContext log 3

Sample Output:
1) _grokparsefailure
2) SUCCESS
3) _grokparsefailure
4) SUCCESS

If you could look into this bug, I'd really appreciate it. Thanks

Revision history for this message
Alex Garel (alex-garel) wrote :

I think you are not in the right project. This is grok the framework based on ztk http://grok.zope.org/
not https://code.google.com/p/semicomplete/wiki/Grok.

Changed in grok:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.