Skip to main content

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.

PyPI version License: MIT

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

License

MIT — Made by Dargslan

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dargslan_log_parser-1.0.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dargslan_log_parser-1.0.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

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

Hashes for dargslan_log_parser-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2ee3171410a610d78223fa7d819775e2946435320db462a62207aa2ffbbeec79
MD5 430bc2a5e854cffe0450aff7ce620b41
BLAKE2b-256 240edad0c668cbd585803855d54975f332f6f8e0fd537dca0190aca453d1cb46

See more details on using hashes here.

File details

Details for the file dargslan_log_parser-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dargslan_log_parser-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92530f3a0b3c3e31343703748228c6a5782c73c998a9d91a4c26971c7a466e56
MD5 1eb20a57abc246a143eecf83b5eca891
BLAKE2b-256 838e8ca692d61948e78c1e0b47d589a1361ba0a3ca63842b015de4b39d448a6f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page