I have a logfile with the following timestamp format
2016-06-02 13:59:58.069
The log I am working with spans about an hour.
2016-06-02 13:05:06.144
2016-06-02 13:05:06.144
2016-06-02 13:05:06.160
2016-06-02 13:05:06.160
2016-06-02 13:05:06.176
2016-06-02 13:05:06.177
.
.
.
.
2016-06-02 14:05:03.033
2016-06-02 14:05:03.034
2016-06-02 14:05:03.034
2016-06-02 14:05:03.084
2016-06-02 14:05:03.096
2016-06-02 14:05:03.112
When I try to use awk to extract out the last 10 minutes I still get the whole file.
awk -vDate=`date -d'now-10 minutes' +%Y/%m/%d:%H:%M:%S` '$1,$2 > Date {print Date, $0}' logfile.log | less
Awk output:
2016/06/02:08:57:35 2016-06-02 13:05:06.144
.
.
.
2016/06/02:08:57:35 2016-06-02 14:08:05.214
What am I doing wrong?