in reply to Re: grep lines from log for last 10 mints
in thread grep lines from log for last 10 mints
So something resembling this
#!/usr/bin/perl -- use strict; use warnings; use Data::Dump; my $command = q{awk} .q{ -v start="$(date -d '10 mins ago' +'%b %e %T')"} .q{ -v end="$(date +'%b %e %T')"} .q{ '} #### ???? .q{ {tm=$1" "$2" "$3}} .q{ ; } .q{ start<tm } .q{ && } .q{ tm<end} .q{ '} .q{ /d/d1/logs/stdout-1132.txt}; dd $command; my $line = qx{$command}; dd $line;
If I knew awk, I'd still recommend converting it to perl using a2p
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: grep lines from log for last 10 mints
by Anonymous Monk on Aug 06, 2012 at 10:30 UTC | |
by bimleshsharma (Beadle) on Aug 06, 2012 at 11:14 UTC | |
by Anonymous Monk on Aug 07, 2012 at 09:22 UTC |