Como usar, consulte a seção "Teste".
#!/bin/bash
# select only dates - five columns from the beginning
dates_only=$(cut -d ' ' -f 1-5 "$2")
# the last date is taking - we will calculate the lower time limit from it.
last_line_time=$(tail -n 1 <(echo "$dates_only"))
# generate the unix time (the amount of seconds from 1970) for
# the each date. It will be the additional column in the next.
dates_to_unix_fmt=$(date '+%s' -f <(echo "$dates_only"))
# find the unix time for the last line time.
print_from=$(date '+%s' -d "${last_line_time} - $1")
# adding the unix time in the beginning of the each line.
# it will be removed in the end by the awk.
paste <(printf "%s\n" $dates_to_unix_fmt) "$2" |
awk -v from="$print_from" '$1 > from {sub(/.*\t/, ""); print;}'
Teste
Entrada (poucas linhas foram adicionadas - para teste)
Sat Sep 9 07:28:18 2017 notifications.google.com 192.168.150.201
Sat Sep 9 07:29:18 2017 notifications.google.com 192.168.150.201
Sat Sep 9 07:31:19 2017 plus.l.google.com 192.168.150.201
Sat Sep 9 07:34:19 2017 plus.l.google.com 192.168.150.201
Sat Sep 9 07:34:53 2017 mail.google.com fe80::dc5f:57fd:640c:6661
Sat Sep 9 07:34:53 2017 mail.google.com 192.168.150.128
Sat Sep 9 07:35:53 2017 www.google.com fe80::dc5f:57fd:640c:6661
Sat Sep 9 07:37:53 2017 www.google.com 192.168.150.128
Sat Sep 9 07:37:40 2017 24-courier.push.apple.com 192.168.150.182
Sat Sep 9 07:38:40 2017 www-cdn.icloud.com.akadns.net 192.168.150.182
Sat Sep 9 07:38:40 2017 e6858.dsce9.akamaiedge.net 192.168.150.182
Sat Sep 9 07:38:40 2017 origin.guzzoni-apple.com.akadns.net 192.168.150.182
Sat Sep 9 07:39:46 2017 beacons.gcp.gvt2.com fe80::dc5f:57fd:640c:6661
Sat Sep 9 07:40:36 2017 beacons.gcp.gvt2.com 192.168.150.128
Sat Sep 9 07:40:41 2017 beacons.gcp.gvt2.com 192.168.150.128
Sat Sep 9 07:40:46 2017 beacons.gcp.gvt2.com 192.168.150.128
Resultado
$ ./time_range.sh "10 sec" input.txt
Sat Sep 9 07:40:41 2017 beacons.gcp.gvt2.com 192.168.150.128
Sat Sep 9 07:40:46 2017 beacons.gcp.gvt2.com 192.168.150.128
$ ./time_range.sh "20 second" input.txt
Sat Sep 9 07:40:36 2017 beacons.gcp.gvt2.com 192.168.150.128
Sat Sep 9 07:40:41 2017 beacons.gcp.gvt2.com 192.168.150.128
Sat Sep 9 07:40:46 2017 beacons.gcp.gvt2.com 192.168.150.128
$ ./time_range.sh "4 min" input.txt
Sat Sep 9 07:37:53 2017 www.google.com 192.168.150.128
Sat Sep 9 07:37:40 2017 24-courier.push.apple.com 192.168.150.182
Sat Sep 9 07:38:40 2017 www-cdn.icloud.com.akadns.net 192.168.150.182
Sat Sep 9 07:38:40 2017 e6858.dsce9.akamaiedge.net 192.168.150.182
Sat Sep 9 07:38:40 2017 origin.guzzoni-apple.com.akadns.net 192.168.150.182
Sat Sep 9 07:39:46 2017 beacons.gcp.gvt2.com fe80::dc5f:57fd:640c:6661
Sat Sep 9 07:40:36 2017 beacons.gcp.gvt2.com 192.168.150.128
Sat Sep 9 07:40:41 2017 beacons.gcp.gvt2.com 192.168.150.128
Sat Sep 9 07:40:46 2017 beacons.gcp.gvt2.com 192.168.150.128
$ ./time_range.sh "2 minute" input.txt
Sat Sep 9 07:39:46 2017 beacons.gcp.gvt2.com fe80::dc5f:57fd:640c:6661
Sat Sep 9 07:40:36 2017 beacons.gcp.gvt2.com 192.168.150.128
Sat Sep 9 07:40:41 2017 beacons.gcp.gvt2.com 192.168.150.128
Sat Sep 9 07:40:46 2017 beacons.gcp.gvt2.com 192.168.150.128