Hey all,
I'm trying to convert a Squid3 log to mimic my Netgear WGR614v8 on stock firmware. So far what I have is as follows. (It may have a typo, I retyped it here instead of copying from a different machine)
FILE=/var/log/squid3/access/log
exec 0<$FILE
while read line; do
TIME=`echo $line | gawk '{ print strftime("%c", $1) }'`
IP=`echo $line | awk '{ print $3 }'`
DOMAIN=`echo $line | awk '{ print $7 }' | cut -d '/' -f 3 | sed 's/^www\.//'`
echo [Site allowed: ${DOMAIN}] from source ${IP}, $TIME
done
Is there a more efficient way to do this?