-
-
Save danwald/9fa42275a152efee590f to your computer and use it in GitHub Desktop.
Extract the last timestamp from a logfile and check if it was more than a minute ago
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOG_TS=$(tail -n 1000 __STR__ | grep INFO | tail -n 1 | grep -Po "\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}") && [[ $((`date +%s`-`date +%s -d"$LOG_TS"`)) -lt 60 ]] || echo "More than a minute" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment