DEV.co
Open-Source Observability · lebinh

ngxtop

ngxtop is a Python CLI tool that provides real-time, top-like monitoring of nginx (and Apache/Caddy) access logs. It parses log files on-the-fly to show request counts, HTTP status distributions, response sizes, and custom aggregations without storing data externally.

Source: GitHub — github.com/lebinh/ngxtop
6.5k
GitHub stars
475
Forks
Python
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorylebinh/ngxtop
Ownerlebinh
Primary languagePython
LicenseMIT — OSI-approved
Stars6.5k
Forks475
Open issues62
Latest releaseUnknown
Last updated2026-03-02
Sourcehttps://github.com/lebinh/ngxtop

What ngxtop is

ngxtop streams log entries, applies optional filters, groups by configurable variables (request path, IP, etc.), and computes aggregations (sum, avg, min, max, count) over a rolling interval. It supports multiple log formats (nginx combined/common, Apache common, Caddy JSON) and can parse remote logs via stdin, making it suitable for ad-hoc diagnostics rather than persistent monitoring.

Quickstart

Get the ngxtop source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/lebinh/ngxtop.gitcd ngxtop# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Troubleshooting sudden traffic spikes or errors

Quickly identify which request paths, client IPs, or status codes are anomalous without pre-configured dashboards; useful for on-call incident response.

Real-time request pattern analysis during load testing

Monitor request distribution and response metrics live while running load tests or deploying changes to validate performance impact.

Quick audit of web server access patterns

One-off inspection of access logs across nginx, Apache, or Caddy servers without standing up a full monitoring stack; can consume remote logs via SSH piping.

Implementation considerations

  • Requires direct or SSH access to log files; ensure file permissions and log format string match actual nginx/Apache configuration.
  • Supports Python 2 and 3, but Python 2 is EOL; upgrade to Python 3 before deployment to avoid security and dependency issues.
  • Follow mode (`--no-follow` flag absent by default) watches for new log lines; initial runs may miss historical data unless explicitly enabled.
  • Custom log formats require exact string match to nginx `log_format` directive; misalignment causes silent parse failures.
  • Filter and group-by expressions are flexible but undocumented syntax; test expressions on small log samples before production use.

When to avoid it — and what to weigh

  • Need persistent, long-term metrics storage — ngxtop is designed for short-lived interactive use, not for persisting metrics to time-series databases or building historical dashboards.
  • Require alerting or automated escalation — No built-in alerting, thresholds, or integrations with PagerDuty, Slack, or other incident systems; manual inspection only.
  • Monitoring high-volume servers (millions of req/sec) — Python-based log parsing may struggle with extreme throughput; purpose is interactive troubleshooting, not production streaming analytics.
  • Need correlated logs with application metrics — ngxtop shows only web server access patterns; does not integrate with APM, distributed tracing, or application performance monitoring.

License & commercial use

Licensed under MIT (MIT License), which is an OSI-approved permissive open-source license allowing commercial use, modification, and distribution with minimal restrictions (retain license notice).

MIT License permits commercial use without fee or royalty. You may use ngxtop in proprietary products, charge customers, and modify code freely provided you include the MIT license notice. No liability or warranty is provided; confirm compliance with your legal team if integrating into commercial offerings.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceModerate
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitPossible
Assessment confidenceHigh
Security considerations

ngxtop processes log files containing request headers, IPs, and URLs; ensure files are stored securely and not exposed in world-readable contexts. When piping remote logs via SSH, verify SSH keys are protected and SSH hosts are trusted. No encryption, signing, or audit logging of ngxtop operations; output is written to stderr/stdout, which may log sensitive data.

Alternatives to consider

Prometheus + node_exporter + nginx module

Production-grade metrics collection and long-term storage with alerting; requires more setup but scales to large deployments and integrates with Grafana.

Datadog / New Relic agents

Commercial SaaS platforms with built-in nginx/Apache dashboards, alerting, and correlated application metrics; higher cost but managed and feature-rich.

GoAccess

Faster C-based log analyzer with real-time terminal UI and HTML/JSON export; similar use case but better performance for high-traffic logs.

Software development agency

Build on ngxtop with DEV.co software developers

ngxtop excels at ad-hoc diagnostics, but for persistent metrics, alerting, and correlated observability across your infrastructure, Devco can help you architect and deploy Prometheus, Grafana, Datadog, or custom monitoring solutions.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

ngxtop FAQ

Can ngxtop parse logs from S3 or cloud storage?
No. ngxtop reads from local or SSH-accessible files only. For cloud logs, you must first download or stream them to a local filesystem.
Does ngxtop require nginx to be recompiled or modified?
No. It parses standard nginx access logs without any nginx module or configuration changes; only the log file path and format string are needed.
What happens if the log format does not match the nginx config?
ngxtop will fail silently or produce incorrect groupings; no explicit error is raised. Always validate format strings against `nginx -T | grep log_format`.
Is ngxtop suitable for monitoring production 24/7?
No. It is a manual troubleshooting tool; for continuous production monitoring, use Prometheus, Grafana, Datadog, or similar platforms with alerting.

Work with a software development agency

DEV.co helps companies turn open-source tools like ngxtop into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source observability stack.

Need Production Monitoring Beyond ngxtop?

ngxtop excels at ad-hoc diagnostics, but for persistent metrics, alerting, and correlated observability across your infrastructure, Devco can help you architect and deploy Prometheus, Grafana, Datadog, or custom monitoring solutions.