The main function of the project is to analyse the access log file of an Apache server.
Project description
Projet “Automatisation des tâches d’administration système”
Name of module : apache_analyser.py
Contributors : WONG Hoe Ziet & BIN AZMI Adam
Overview
This is a project of the module "Automatisation of System Administration Tasks" for the course of Diplôme Universitaire Technologie (DUT) Réseaux & Télécommunications.
The main function of the project is to analyse the access log file of an Apache server. The project is consisted of functions that are built to be able to inspect and analyse the data extracted from the log file and provide insights to client notably in the security and commercial point of view. The details and explanation of each the functions can be found below. The project also contains a simple Command Line Interface (CLI) that will facilitate the usage of the functions.
Targetted User
Our targetted audience is the mainly the user of Apache server, specifically the server adminstrator or development team. This program can also eventually serve as model for other server who uses the same logging format.
Installation
The package of the project will be available on PyPi soon after the complete structuring and validation. Stay tuned!
Usage
In the version 1.0.0 of this module, it contains a total of 10 functions that are conceived to facilitate the analysis of a running Apache server. Thanks to our CLI you can choose whichever functions that you wish.
Note : You will have to use "option --a" when running the code for the first time to convert the file into the format of JSON
-
1. convert_json (option --a)
This function is used to convert a log file to json format. This function must be used when running the module for the first time.
apache_analyser.py path/to/your/log/file --a
-
2. count_os (option --b)
This function will help to detect the exploitation system (OS) used by clients. It generates percentage and graph showing the usage of each OS.
apache_analyser.py path/to/your/log/file --b
-
3. average_os (option --c)
It helps to calculate the average size of objects requested by clients. On top of that, it also provides the maximum and minimum size of objects requested. This allow us to anticipate the traffic on the server, adapt the contains and adapt the bandwidth of the network according to the calculation.
apache_analyser.py path/to/your/log/file --c
-
4. trafic_du_jour (option --d)
This function is used to track the volume of visitors of the day, allowing us to monitor the current traffic on the server.
apache_analyser.py path/to/your/log/file --d
-
5. count_method (option --e)
With this function, we can observe and analysis the request methods used by the visitors. The analyse is carried on 4 most common request methods : GET, POST, HEAD and PUT. It also generates percentage and graph to provide a clearer representation.
apache_analyser.py path/to/your/log/file --e
-
6. heure_creuse (option --f)
This function allow us to identify the peak hour on a server. This is undoubtedly crucial from the commercial point of view. For example, it will help to provide an insight on the best time to publish contains on a website.
apache_analyser.py path/to/your/log/file --f
-
7. count_response (option --g)
This function will collect the data on HTTP Response Code. It will list 10 most common response code issued on the server along with their frequencies. From the security point of view, this function can serve as an red flag, providing early info to prevent attacks or dysfunctions on the server. Code in the range of 400 and 500 can potentially implicates security concern (loopholes for hacker) especially if the frequency is high. It also comes with percentage and graph interpretations.
apache_analyser.py path/to/your/log/file --g
-
8. analyse_ip_addr (option --i)
This function will help to provide an analyse on the remote IP address or the IP address of clients. It is valuable from the security point of view as a repetitive IP address may possibly be a thread to the server. Combine with the data from other functions, a conclusion can certainly be deduced.
apache_analyser.py path/to/your/log/file --i
-
9. analyse_doc_type (option --j)
This function is used to analyse the type of document requested by clients. The top 10 types of documents will be presented in the form of numbers, percentage and graph. By knowing the document type, we can study the general behaviour of client and adapt our contents following the trends.
apache_analyser.py path/to/your/log/file --j
-
10. count_browser (option --k)
This function will help to collect information of the browser used by clients. Indirectly, this can be exploited to strengthen commercialisation. For example, the advertissements can be posted more on certain browser with high traffic.
apache_analyser.py path/to/your/log/file --k
-
11. Manual (option -h / --help)
This option provides you with a mini manual on how to choose the options
apache_analyser.py path/to/your/log/file -h
apache_analyser.py path/to/your/log/file --help
-
12. Version (option -V/ --version)
This option will show you the current version of the module
apache_analyser.py path/to/your/log/file -V
apache_analyser.py path/to/your/log/file --version
Code Style
The module is written in compliant with the conventions of PEP8
Reporting Bugs
Teamwork is the key, please report at https://github.com/Zac-not-Zack/apache_analyser/issues if you come across any bug.
Licence
MIT License
Copyright (c) 2021 Wong Hoe Ziet & Adam Bin Azmi
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file apache_analyser-1.0.0.tar.gz
.
File metadata
- Download URL: apache_analyser-1.0.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7a89fd5dac12d568737e07ac3ece563d0d03b06cdbe2bf94c64f0aef91ca44b |
|
MD5 | 727708a570c549bdfbae374befe95aa8 |
|
BLAKE2b-256 | 76a2a8d94e6a9df624b209778f775860d93d19a0110c3e542fb66f06dc12539d |
File details
Details for the file apache_analyser-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: apache_analyser-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdc45dc841b44541ab6060bbd86a6561d5e68e3a0d02ac10db17688f9cb5b199 |
|
MD5 | b49bbbec54cf0a3d5b253eaf480a8d1f |
|
BLAKE2b-256 | 1364debefe266652f7914da2c188fef052433720af5e9da3fb519bbe4f393395 |