Skip to content

Instantly share code, notes, and snippets.

@pixmin
Last active September 28, 2018 15:03
Show Gist options
  • Select an option

  • Save pixmin/927791b16f758d24a1900d4dcde7afc3 to your computer and use it in GitHub Desktop.

Select an option

Save pixmin/927791b16f758d24a1900d4dcde7afc3 to your computer and use it in GitHub Desktop.
Tail Apache access logs
#!/bin/bash
tail -n 200 -f /var/log/apache2/www.labelleiloise.fr/access.log \
| grep -vE ".png|.jpg|.gif|.js|.ico|.css|.svg|POST /bms-admin/ajax|.woff2|/php-fpm-status" \
| egrep --color '^|POST|GET|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|HTTP/1.1" [^2][0-9]{1,2}'
# first egreo regex is for IP Address,
# second is for HTTP reponse codes other than 2xx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment