PHP Developer

My notes and thoughts about Linux, WordPress, PHP, WPML, Toolset and many more.

How to analyze Cpanel raw access log entries very easily?

Cpanel raw access log provides a complete detail of all request made to your Apache server. This request includes:

a.) Normal visitors coming from search engines or to other referring websites.
b.) Search engine bots.
c.) Malware bots or hacking bots.

It is important to pay attention to your raw access log because it provides a clue about how your visitors are actually doing in your website. Are most of them actually reading your content? Or just busy hacking your website?

This tutorial is applicable to Apache web hosting that uses Cpanel and you are using Linux (both for local development and for your hosting). To get started, please refer to the procedure below:

Step1). Login to your Cpanel hosting account. This is provided by your web hosting company.
Step2). Under “Logs” click “Raw Access Logs”.
Step3). Click the log of the domain which you would like to analyze the access logs.
Step4). The downloaded logs is not exactly a text file but at first, it is a gzip archive file(this will also depend on the hosting company). You can extract it to your Linux desktop.

After extracting, it will become a plain text document. Lets try opening this file. This is how it looks like when you first opened it:

raw access logs in text format

As you can see, it is very difficult to understand because the details are thrown anywhere. You cannot analyze the data properly. To make the analysis easy for you, one of the best tips is to analyze the data using a spreadsheet format. Having the data summarized in spreadsheet format is user-friendly and will be easy to manipulate. Follow the steps below:

Step1.) Right click on the access log text file.
Step2.) Open with – > Spreadsheet. If you do not have Open office installed, then you cannot follow this step.
Step3.) A preview of the output will be shown below, make sure your Openoffice calc is configured as follows:

access logs configuration in open office calc
Finally click OK to proceed.

Step4.) Now the data is well presented in a spreadsheet format such as shown below:

access logs in spreadsheet format

Step5.) You can now easily analyze the data just like any other spreadsheet data. For example:

a.) You can use the spreadsheet filter actions to filter the entries by IP address.
b.) Or you can also filter rows to those having 404 header status only or other header status that you need (200, 301, 302 or 500)

Other information that you can filter are as follows:
a.) User agent
b.) Date
c.) Requested URLs (you can get a clue whether these request are malicious in nature or not.)

Can this tutorial work for me if I am using Windows? Yes as long as you are able to download your raw access log from Cpanel, you can follow the steps discussed in this tutorial provided you install OpenOffice in your Windows computer.

Featured image credits:

One thought on How to analyze Cpanel raw access log entries very easily?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">