Skip to content

Vinukondashiva/Python-Log-Analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Python Security Log Analyzer

๐Ÿ“– What is this?

This is a simple Python script that reads a web server's log file. It finds all the "404 Not Found" errors, counts how many times each IP address caused an error, and creates a clean report showing the top 5 attackers. It's a useful tool to find possible threats from log files.

โœจ Features

  • Reads a log file to find important information.
  • Finds all the lines that have a "404 Not Found" error.
  • Counts how many different IP addresses are causing these errors.
  • Sorts the IP addresses to show the most frequent attackers at the top.
  • Creates a simple security_report.txt file with a list of the top 5 attackers.

๐Ÿ› ๏ธ What I Used

  • Language: Python 3
  • Main Ideas: Reading and writing files, using dictionaries to count things, using lists to hold data, and sorting.

๐Ÿš€ How to Run It

  1. You need Python 3 on your computer.
  2. Download (clone) this project.
  3. Go into the project's folder.
  4. Run this command in your terminal:
    python3 log_analyzer.py
  5. After the script runs, you will find a new file named security_report.txt with the results.

๐Ÿ–ผ๏ธ Screenshots

Terminal Output: Terminal Output

Sample Report (security_report.txt): Sample Report

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages