5

Need help with awk and access log

view full story
linux-howto

http://www.unix.com – when i run this command: Code: tail -200 /var/log/httpd/access_log | awk -F'[][]' '{sub(/:[^:]*$/,"",$2);print $2}' i get: Code: 13/Aug/2012:20:56 13/Aug/2012:20:56 13/Aug/2012:20:56 13/Aug/2012:20:56 13/Aug/2012:20:56 13/Aug/2012:20:56 13/Aug/2012:20:56 13/Aug/2012:20:56 13/Aug/2012:20:56 13/Aug/2012:20:56 13/Aug/2012:20:56 now i need to alter the awk command to instead output: Code: 13/Aug/2012:20 13/Aug/2012:20 13/Aug/2012:20 13/Aug/2012:20 13/Aug/2012:20 13/Aug/2012:20 13/Aug/2012:20 13/Aug/2012:20 13/Aug/2012:20 13/Aug/2012:20 13/Aug (HowTos)