I have to make a shell script such that each time it is executed it goes to the log file which is common and gets updated. What is already being done is pick all the erroneous logs and show as output. But now I want this to be like it picks logs which is certain minutes older and no more.
grep is good for fetching the timestamp line. But how do I do it to get only fresh data and not too old.
grep -i error log.log | grep `date +%Y'-'%m'-'%d`
Log file format is as follows : '[date in YYYY-mm-dd timestamp] - error/exception generated'
Any help will be appreciated. Thank you all in advance.