It's a bash script to parse an apache access log file.
Analysizing Apache log files to count most visited Unique Ip , to see http status codes , request method and most viewed unique URLS manually is an not an easy task due to the size of log file and less readability of log file.
Every time a web page is requested, an email sent or a login made, the event is recorded in a log file. An essential skill for any system administrator is to be to able parse through log files and extract useful information.
This script can be used for this purpose:
The script will extract data from log file such as :
- IDENTIFY FROM WHICH IPS MY SERVER HAS BEEN ACCESSED MORE AND HOW MANY TIMES (TOP 20 IP ADDRESSES )
- View request types GET/HEAD/POST/DELETE that are happening the most
- View highest 20 requested unique base URLs.
- View the most common response codes your visitors are causing.
- To get sample access log for practice purpose use:
wget http://www.almhuette-raith.at/apache-log/access.log
- git clone https://github.com/NITHIN-JOHN-GEORGE/apache_log_parser.git
- cd apache_log_parser
- In prod environment where real access log is available , update the access log file path in script starting
Log_File=<apache access log file absolute path>
- ./apache_log_analyser.sh