I have logs in format
I am looking out for a script which can extract data of last 15 minutes from the last recorded data in the log file and then search a string in it and store the results in a file.
Additionally, I tried the below command but doesn't work for me
Code:
####<01-Mar-2015 03:48:18 o'clock GMT> <info>
####<01-Mar-2015 03:48:20 o'clock GMT> <info>
####<01-Mar-2015 03:48:30 o'clock GMT> <info>
####<01-Mar-2015 03:48:39 o'clock GMT> <info>
Additionally, I tried the below command but doesn't work for me
Code:
awk '$0>=$from' from=$(`date -u +"####<%d-%b-%Y %H:%M:%S o'clock GMT>" -d -5min`) test.log | grep -m1 -C5 'WORD'