LogInsight is a Python-based log file analyzer that extracts meaningful insights from server logs. It provides functionalities to analyze requests per IP address, identify frequently accessed endpoints, and detect suspicious activities. Additionally, the results are saved in a well-structured CSV file for further review.
- Requests Per IP Address: Analyze and display the count of requests made by each IP address.
- Most Accessed Endpoint: Identify the most frequently accessed endpoint or resource in the log file.
- Suspicious Activity Detection: Detect IP addresses with failed login attempts exceeding a customizable threshold.
- Save to CSV: Export the analysis results to a structured CSV file with separate sections for each feature.
- Clone the repository:
git clone https://github.com/Priyansu-Bhandari/LogInsight-.git cd LogInsight - Update the log_file_path variable in the script to point to your log file.
- Run the script:
python log_insight.py
- View results in the terminal and the generated CSV file (log_analysis_results.csv).
- Requests Per IP
IP Address Request Count
192.168.0.1 123
203.0.113.45 98
- Most Accessed Endpoint
/endpoint/path (Accessed 345 times)
- Suspicious Activity
IP Address Failed Login Attempts
203.0.113.45 15
192.168.0.1 12
The results are saved in a file named log_analysis_results.csv with the following sections:
- Requests per IP
- Most Accessed Endpoint
- Suspicious Activity