It seems I have problems with my connection pool tool. There is a big delay when it obtains the DB connection.
What I try to achieve is to get all the cases from log file when this incident occurs.
The related log entries look like
... 2018-03-12 16:18:44,070 efault task-166 gine.jdbc.internal.LogicalConnectionImpl DEBUG Obtaining JDBC connection ... 2018-03-12 16:20:23,172 efault task-166 gine.jdbc.internal.LogicalConnectionImpl DEBUG Obtained JDBC connection ...
So if the pattern 'DEBUG Obtaining JDBC connection' occurs then extract the date '2018-03-12 16:18:44,070' and when the pattern 'DEBUG Obtained JDBC connection' is found then extract its date and compare the 2 dates. If the difference is more than 2 sec then log then.
I know it is pretty complicated to solve it with one line of code but is it possible without writing a program to do that?