Last active
November 13, 2024 09:25
-
-
Save marcanuy/a08d5f2d9c19ba621399 to your computer and use it in GitHub Desktop.
Apache error log list ordered by most common errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sed 's^\[.*\]^^g' error.log | sed 's^\, referer: [^\n]*^^g' | sort | uniq -c | sort -n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Based in http://strictcoder.blogspot.com/2012/02/linux-count-unique-error-log-entries.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 AH00126: Invalid URI in request GET HTTP/1.1 | |
1 PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 32 bytes) in /var/www/con/libraries/joomla/database/driver/mysql.php on line 425 | |
108 PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 512 bytes) in /var/www/es/libraries/joomla/database/driver/mysql.php on line 425 | |
156 PHP Notice: Undefined index: select in /var/www/con/cli/form_output.php on line 3 | |
156 PHP Notice: Undefined index: inputfrom_value in /var/www/con/cli/form_output.php on line 2 | |
157 PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 83 bytes) in /var/www/es/libraries/joomla/database/driver/mysql.php on line 425 | |
202 PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 32 bytes) in /var/www/es/libraries/joomla/database/driver/mysql.php on line 425 | |
218 PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 80 bytes) in /var/www/es/libraries/joomla/database/driver/mysql.php on line 425 | |
316 PHP Notice: Undefined index: in /var/www/conven/cli/units.php on line 513 | |
520 PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 81 bytes) in /var/www/es/libraries/joomla/database/driver/mysql.php on line 425 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks for wonderful script. below is for compressed log file (e.g. error.log.gz):
!/bin/bash
zcat error.log.gz | sed 's^[.]^^g' | sed 's^, referer: [^\n]^^g' | sort | uniq -c | sort -n