Linux log file parser and analyzer — parse syslog, auth.log, nginx, and Apache logs with pattern matching
Project description
dargslan-log-parser
Linux Log File Parser & Analyzer — Parse and analyze syslog, auth.log, nginx access/error logs, and Apache logs. Detect failed SSH logins, error patterns, and security events.
Installation
pip install dargslan-log-parser
Quick Start
from dargslan_log_parser import LogParser
parser = LogParser()
# Parse auth.log for failed SSH logins
failed = parser.parse_auth_log("/var/log/auth.log")
for entry in failed:
print(f"{entry['timestamp']} - Failed login from {entry['ip']} as {entry['user']}")
# Parse nginx access log
entries = parser.parse_nginx_access("/var/log/nginx/access.log")
errors = [e for e in entries if e["status"] >= 400]
# Search any log for patterns
matches = parser.search("/var/log/syslog", pattern="error|warning|critical", case_insensitive=True)
# Summary report
report = parser.summary("/var/log/auth.log", log_type="auth")
print(f"Failed logins: {report['failed_logins']}")
print(f"Top attackers: {report['top_ips']}")
CLI Usage
# Analyze auth log
dargslan-logs auth /var/log/auth.log
# Parse nginx access log
dargslan-logs nginx /var/log/nginx/access.log --errors-only
# Search any log
dargslan-logs search /var/log/syslog -p "error|fail" -i
# Summary
dargslan-logs summary /var/log/auth.log --type auth
More Resources
- Linux & DevOps eBooks — 210+ professional eBooks
- Free Cheat Sheets — Quick reference PDFs
- Blog & Tutorials — In-depth guides
License
MIT — Made by Dargslan
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dargslan_log_parser-1.0.0.tar.gz.
File metadata
- Download URL: dargslan_log_parser-1.0.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ee3171410a610d78223fa7d819775e2946435320db462a62207aa2ffbbeec79
|
|
| MD5 |
430bc2a5e854cffe0450aff7ce620b41
|
|
| BLAKE2b-256 |
240edad0c668cbd585803855d54975f332f6f8e0fd537dca0190aca453d1cb46
|
File details
Details for the file dargslan_log_parser-1.0.0-py3-none-any.whl.
File metadata
- Download URL: dargslan_log_parser-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92530f3a0b3c3e31343703748228c6a5782c73c998a9d91a4c26971c7a466e56
|
|
| MD5 |
1eb20a57abc246a143eecf83b5eca891
|
|
| BLAKE2b-256 |
838e8ca692d61948e78c1e0b47d589a1361ba0a3ca63842b015de4b39d448a6f
|