logstash-plugins / logstash-patterns-core

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Minor change required for TOMCAT_DATESTAMP in patterns/java

rbjorklin opened this issue · comments

Using Ubuntu 14.04 not all timestamps in catalina.out matches the provided regexp. Some timestamps are without timezone. A simple and hopefully correct fix for this would be to make the timezone optional. By changing line 17 in patterns/java from:

TOMCAT_DATESTAMP 20%{YEAR}-%{MONTHNUM}-%{MONTHDAY} %{HOUR}:?%{MINUTE}(?::?%{SECOND}) %{ISO8601_TIMEZONE}

to

TOMCAT_DATESTAMP 20%{YEAR}-%{MONTHNUM}-%{MONTHDAY} %{HOUR}:?%{MINUTE}(?::?%{SECOND}) ?%{ISO8601_TIMEZONE}?

solves this problem locally for me. Notice the two added ?, one for the last space and another for ISO8601_TIMEZONE.

expected to be addressed by #268 honestly I wasn't able to find a log example where the time-zone would have been included (used to be always local or whatever -Duser.timezone was set).