Filter Apache logs to exclude js, css and images


Posted by Andrew McCombe on Wed Aug 7, 2013

Quite often I find myself having to filter Apache logs to exclude JS, CSS and images. I use a combination of cat and egrep to achieve this:

grep '11.22.33.44' accesss_log | egrep -v "(.gif|.jpg|.png|.swf|.ico|.txt|.xml|.css|.js|.rss)"