grep lines from log for last 10 minutes code example

grep lines from log for last 10 minutes

1

1 Example

0
d1=$(date --date="-10 min" "+%b %_d %H:%M")
d2=$(date "+%b %_d %H:%M")
while read line; do
    [[ $line > $d1 && $line < $d2 || $line =~ $d2 ]] && echo $line
done
by on

Other Code Examples