
The definitive analysis for your proxy
[](https://github.com/kaelthasmanu/SquidStats/)
[](https://github.com/kaelthasmanu/SquidStats/blob/master/LICENSE)
[](https://github.com/kaelthasmanu/SquidStats/stargazers)
[](https://github.com/kaelthasmanu/SquidStats/members)
[](https://github.com/kaelthasmanu/SquidStats/)
[](https://github.com/kaelthasmanu/SquidStats/)
[](https://github.com/kaelthasmanu/SquidStats/watchers)
:star: Give me one star — it will motivate me to keep improving it!!
Table of contents
-
About the Project
-
Getting Started
- To do
- Contributing
- License
- Contact
- Technologies Used
- Special thanks
## About the Project
*A modern tool for parsing and analyzing Squid logs, providing a sleek and user-friendly dashboard to visualize real-time connection data. This project helps network administrators monitor and manage Squid proxy connections effectively.*
**You can view the example [here](https://github.com/kaelthasmanu/SquidStats/tree/main/assets "Examples").**
Goals of this project :
- Real-time Log Parsing: Parses active Squid connections and displays detailed information.
- User Monitoring: Identifies connections by username, URI, and log type.
- Metrics Overview:
- Total read and written data for each connection.
- Number of requests per connection.
- Delay pool usage.
- Interactive Dashboard: Clean interface for easy data interpretation.
- Squid Cache Statistics:
- Stored entries.
- Used and free capacity
- Maximum and current cache size
- Disk space and inode usage
- Age of cached objects
- Logs Users:
- User activity monitoring 👥
- Beautiful visualizations 📊
- Advanced filtering & search 🔍
- Paginated results 📄
- Top Graphs:
- Top 20 Users Activity
- Top 20 Users Data Usage
- Total Users
- Total Transmitted Data
- Total Request
- And More...
- And More

Getting Started

The entire installation process in more detail can be found here.
Prerequisites
- Python 3.10+
- Squid proxy server
squidclient installed on the server
apt install git python3 python3-pip python3-venv python3-pymysql libmariadb-dev curl
⚠️ !!Important ⚠️ For compatibility with user logs, use this format in /etc/squid/squid.conf:
logformat detailed \
"%ts.%03tu %>a %ui %un [%tl] \"%rm %ru HTTP/%rv\" %>Hs %<st %rm %ru %>a %mt %<a %<rm %Ss/%Sh %<st
access_log /var/log/squid/access.log detailed
Installation Script
Get Script With curl o wget:
wget https://github.com/kaelthasmanu/SquidStats/releases/download/0.2/install.sh
Add permission execution:
sudo chmod +x install.sh
Execute the script:
sudo ./install.sh

Installation Manual
Clone the repository:
mkdir -p /opt/squidstats
git clone https://github.com/kaelthasmanu/SquidStats.git /opt/squidstats
Creating a virtual environment (venv):
cd /opt/squidstats/
python3 -m venv "/opt/squidstats/venv"
source venv/bin/activate
pip install --upgrade pip
Install requeriments python with pip or pip3:
pip install -r /opt/squidstats/requirements.txt
Create a .env file in the project root and add the following content:\
Note: for use MARIADB need your own database running
VERSION=2
SQUID_HOST = "127.0.0.1"
SQUID_PORT = 3128
FLASK_DEBUG = "True"
DATABASE_TYPE="SQLITE"
SQUID_LOG = "/var/log/squid/access.log"
DATABASE_STRING_CONNECTION = "/opt/squidstats/"
REFRESH_INTERVAL = 60
Run App with python or python3 🚀:
python3 app.py
With your preferred browser, visit the installation URL:
http://ip/hostname:5000
⚠️ First Execution Alert ⚠️
Warning: 🚨 The first execution may cause high CPU usage.
Update project(web) with Script
Get Script With curl o wget:
wget https://github.com/kaelthasmanu/SquidStats/releases/download/0.2/install.sh
Add permission execution:
sudo chmod +x install.sh
Execute the script with parameters update:
sudo ./install.sh --update
🕒 Run on System Startup
To ensure the application starts automatically when the system boots, add the following cron job:
Open with a editor the file crontab
nano /etc/crontab
Add the following line to the crontab file(change path_app for your path):
@reboot root nohup python3 path_app/app.py &
Save
Or can use service(daemon):
Copy file service:
cp ./utils/squidstats.service /etc/systemd/system/squidstats.service
Restart daemons:
systemctl daemon-reload
Enable service:
systemctl enable squidstats.service
Start service:
systemctl start squidstats.service

Testing Information
This software has been thoroughly tested and is compatible with Squid version 6.12 in Ubuntu 24.04 and Debian12. Please ensure your Squid installation matches this version or newer for optimal performance.
To do
Make blah blah.
Contributing
Fork the repository:
git checkout -b feature-name
2.Create a new branch for your feature or fix:
git checkout -b feature-name
3.Commit your changes and push the branch:
git push origin feature-name
4.Open a pull request.
Contributors
<th><b>Kaelthas</b></th>
<th><b>Alexminator</b></th>
<td align="center"><a href="https://github.com/kaelthasmanu"><img src="https://avatars.githubusercontent.com/u/39976595?v=4" width=150px height=150px alt="kaelthasmanu"/></a></td>
<td align="center"><a href="https://github.com/alexminator"><img src="https://avatars.githubusercontent.com/u/9116486?s=400&v=4" width=150px height=150px alt="alexminator"/></a></td>
<td align="center"></a> <a href="https://www.linkedin.com/in/manuel-gorrin-095242238/"><img src="assets/linkedin-48.png" width="32px" height="32px"></a><a href="https://t.me/king_0f_deathhh"><img src="assets/telegram-app-48.png" width="32px" height="32px"></a></td>
<td align="center"><a href="https://twitter.com/alexminator99"><img src="assets/x_48.png" width="32px" height="32px"></a> <a href="https://www.linkedin.com/in/alexander-rivas-73532037/"><img src="assets/linkedin-48.png" width="32px" height="32px"></a><a href="https://t.me/Alexminator"><img src="assets/telegram-app-48.png" width="32px" height="32px"></a></td>
License
The SquidStats project is released under the MIT license.
Contact
Need help?
_Feel free to contact me 📨 manuelalberto.gorrin@gmail.com_
Project Link: (SquidStats)
Technologies Used
Backend: Python, Flask
Frontend: HTML, CSS
Special thanks
- To the Cuban Sysadmins community.
- To everyone who gave me his help when I had doubts.
