Grep logs between to 2 timestamps?
Am trying to grep logs between 02/Aug/2018:13:12:00 and 02/Aug/2018:13:15:59 but unable to succeed with single command.
Please suggest if there is any single command to display logs of above timestamps.
Regards,
Mel
-
Can you use journalctl?. If yes: journalctl --since "2015-06-26 23:15:00" --until "2015-06-26 23:20:00" 0 -
Hello, If you can't use journalctl as suggested by @rarod awk would most likely work. Something similar to what's suggested here: How to extract logs between two time stamps and Get lines between two timestamps from a file Thanks! 0 -
The simplest solution: grep 02/Aug/2018:13:1[2-5]: This will match lines that have 02/Aug/2018:13:12:, 02/Aug/2018:13:13:, 02/Aug/2018:13:14:, and 02/Aug/2018:13:15: admittedly this get a bit more complicated if the time frame is narrowed down much more or more complex. 0 -
Although had liked messages long back, want to say Thank you for the assistance. 0 -
get a bit more complicated if the time frame is narrowed down much more or more complex. 0
Please sign in to leave a comment.
Comments
5 comments