Comento, tengo archivos con log y necesito filtrar por consola entre rango de fecha - hora, pero sin utilizar algún archivo de script.
Estoy tratando con grep pero sin el resultado correcto.
Ejemplo de archivo: (prueba.log)
Jul 11 15:17:01 adm CRON[1011]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 11 15:17:01 adm CRON[1012]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jul 11 15:17:01 adm CRON[1011]: pam_unix(cron:session): session closed for user root
Jul 11 15:46:12 adm sshd[1059]: Accepted password for user from 192.168.1.1 port 46510 ssh2
Jul 11 15:46:12 adm sshd[1059]: pam_unix(sshd:session): session opened for user user by (uid=0)
Jul 11 16:17:01 adm CRON[1162]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 11 16:17:01 adm CRON[1163]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jul 11 16:17:01 adm CRON[1162]: pam_unix(cron:session): session closed for user root
Jul 11 16:57:02 adm sshd[32709]: pam_unix(sshd:session): session closed for user user
Jul 11 17:17:01 adm CRON[1166]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 11 17:17:01 adm CRON[1167]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jul 11 17:17:01 adm CRON[1166]: pam_unix(cron:session): session closed for user root
Jul 11 18:01:24 adm sshd[1059]: pam_unix(sshd:session): session closed for user user
Jul 11 18:17:01 adm CRON[1173]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 11 18:17:01 adm CRON[1174]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jul 11 18:17:01 adm CRON[1173]: pam_unix(cron:session): session closed for user root
Jul 11 18:48:04 adm sshd[1176]: Accepted password for entel01 from 192.168.1.1 port 33295 ssh2
Jul 11 18:48:04 adm sshd[1176]: pam_unix(sshd:session): session opened for user entel01 by (uid=0)
Jul 11 19:05:40 adm sshd[1176]: pam_unix(sshd:session): session closed for user entel01
Jul 11 19:17:01 adm CRON[1306]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 11 19:17:01 adm CRON[1307]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jul 11 19:17:01 adm CRON[1306]: pam_unix(cron:session): session closed for user root
Jul 11 20:17:01 adm CRON[1312]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 11 20:17:01 adm CRON[1313]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jul 11 20:17:01 adm CRON[1312]: pam_unix(cron:session): session closed for user root
Jul 11 21:17:01 adm CRON[1317]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 11 21:17:01 adm CRON[1318]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jul 11 21:17:01 adm CRON[1317]: pam_unix(cron:session): session closed for user root
Jul 11 22:17:01 adm CRON[1321]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 11 22:17:01 adm CRON[1322]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jul 11 22:17:01 adm CRON[1321]: pam_unix(cron:session): session closed for user root
Jul 11 23:17:01 adm CRON[1325]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 11 23:17:01 adm CRON[1326]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jul 11 23:17:01 adm CRON[1325]: pam_unix(cron:session): session closed for user root