http://www.perlmonks.org?node_id=985640

bimleshsharma has asked for the wisdom of the Perl Monks concerning the following question:

I want to grep lines from log that is updated in last 10 mints. I tried with below but not getting result.

my $line= `awk -v start="$(date -d '10 mins ago' +'%b %e %T')" -v end +="$(date +'%b %e %T')" '{tm=$1" "$2" "$3}; start<tm&&tm<end' /d/d1/l +ogs/stdout-1132.txt` print "$line";