Filter Apache logs to exclude js, css and images

August 7th, 2013

Warning: This post is 10 years old. Some of this information may be out of date.

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 '' access_log | egrep -v "(.gif|.jpg|.png|.swf|.ico|.txt|.xml|.css|.js|.rss)"