fluent/fluentd — pull request #64 by achied (2012-09-04 11:21:12+00:00)
Title: Fix SYSLOG_ALL_REGEXP

When day of the month is one-digit SYSLOG_ALL_REGEXP doesn't match time properly

``` ruby
message = "<30>Sep 4 09:23:02 fluent dhclient: DHCPACK of 192.168.20.8 from 192.168.20.1" # from fluent debug

# fluent.warn: {"message":"\"<30>Sep 4 09:23:02 fluent dhclient: DHCPACK of 192.168.20.8 from 192.168.20.1\"","error":"invalid strptime format - `%b %d %H:%M:%S'"}

SYSLOG_ALL_REGEXP = /^\<(?[0-9]+)\>(?[^ ]*\ [^ ]*\ [^ ]*) (?[^ ]*) (?[a-zA-Z0-9_\/\.\-]*)(?:\[(?[0-9]+)\])?[^\:]*\: *(?.*)$/
m = SYSLOG_ALL_REGEXP.match(message)
m[:time] # output Sep 4
m[:host] # output 09:23:02
```
Care for two spaces between Sep and 4

When day of the month is two-digit SYSLOG_ALL_REGEXP matches time properly

SYSLOG_ALL_REGEXP assumes that there will be a single space

With this minor fix time matches properly