I'm trying to use the following command to extract a time period forthe current day date and grep for the specific message as you can see below:
awk -v date="$(date +%Y%m%d')" '$1="date" && $3>"180000" && $3<"192000"' /app/exploit/log/FILE_send.log | grep "End success file transfer /app/reception/FILENAME.dat to HOSTX"
But I'm having trouble to filter by the date column which is the first. Here's the output of the awk command when I remove the variable from the awk command and specify a date on $1=20190405:
1 - 180050 | INFO | FILE_SEND.sh | | FILENAME.dat | 1800498307000 | End success file transfer /app/reception/FILENAME.dat to HOSTX
Here is the line that log has:
20190405 - 180050 | INFO | FILE_SEND.sh | | FILENAME.dat | 1800498307000 | End success file transfer /app/reception/FILENAME.dat to HOSTX
I can't see the reason for the column be replaced by 1. How can I filter the first column for the current day.