I was checking the nginx error logs at our server and found that they start with date formatted as:
2015/08/30 05:55:20
i.e. YYYY/MM/DD HH:mm:ss
. I was trying to find an existing grok date pattern which might help me in parsing this quickly but sadly could not find any such date format. Eventually, I had to write the pattern as:
%{YEAR}/%{MONTHNUM}/%{MONTHDAY}[T ]%{HOUR}:?%{MINUTE}(?::?%{SECOND})?%{ISO8601_TIMEZONE}?
I am still hoping if there is a shorter pattern for the same ?
[T ]
and%{ISO8601_TIMEZONE}?
? Looking at your single example they're unnecessary. Also, why make the seconds optional? – Tonettetoney