Filter Apache logs to exclude js, css and images

August 7, 2013

Image for Filter Apache logs to exclude js, css and images from unsplash.com

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)"