I need to extract last 5mins log from log file. Here is my log file
[2022-02-08 13:26:21:352] [ERROR] [iBus Connection LifeCycle - CCMHost_DummyDevice_Backup_AD2::Management:::NRMCMO_FLPROD2] [com.example]
+ Message: Could not create an administered connection factory: Java heap space
+ Throwable: java.lang.OutOfMemoryError: Java heap space
[2022-02-08 15:09:37:068] [ERROR] [HikariCP connection filler (pool DirectReadConnection.9c292fc0.210e0ac7)] [com.example]
+ Message: Unable to Initialize Connection
+ Throwable: java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
[2022-02-08 15:09:37:068] [ERROR] [HikariCP connection filler (pool DirectReadConnection.9c292fc0.210e0ac7)] [com.example]
+ Message: Unable to Initialize Connection
+ Throwable: java.sql.SQLException: Listener refused the connection with the following error:
ORA-01017, TNS:listener does not currently know of SID given in connect descriptor
[2022-02-08 15:05:04:056] [ERROR] [JMS Session Delivery Thread - The user's password has expired.] [com.example]
I tried by using this but not working
awk -v d1="$(date --date="2 hour ago" "+%Y-%m-%d %H:%M:%S:%3N")" -v d2="$(date "+%Y-%m-%d %H:%M:%S:%3N")" '$0 > d1 && $0 < d2 || $0 ~ d2' filelog.log
Any help will be appreciated