I'm having difficulty coming up with a pattern for the following log entry.
[INFO ] 2020-02-07 16:11:56.148 [localhost-startStop-1] DOMUtilities - System property DocumentBuilderCacheBlockSize is not defined, using default 25
The following is what I have.
%{LOGLEVEL:loglevel} %{YEAR} %{MONTH} %{MONTHDAY} %{HOUR}:%{MINUTE}:%{SECOND}[%{DATA:threadName}\]\s+\%{DATA:javafile}\s[-:]\s+%{GREEDYDATA:message}
Can anyone fill me in on what I am doing wrong please? I know the issue lies around the date format but I just cannot find the answer.
Your grok-pattern has multiple issues (order is based on occurrence in grok pattern):
[%{DATA:threadName}\]
since its a special character in regex%{DATA:javafile}
Please take a more detailed look at the logstash grok-patterns and their definitions.
With the example log you've provided I came up with the following pattern:
^\[%{LOGLEVEL:loglevel}\s?+\]\s+%{YEAR}-%{MONTHNUM2}-%{MONTHDAY}\s+%{HOUR}:%{MINUTE}:%{SECOND}\s+\[%{DATA:threadName}\]\s+%{DATA:javafile}\s[-:]\s+%{GREEDYDATA:message}
You can verify your patterns on this page.
I hope I could help you.