top for NGINX
This tool is a rewrite of ngxtop to make it easier to install and hopefully run faster. For those unfamiliar with the ngxtop, it is a tool that helps you parse NGINX access logs and print various statistics from them regardless of format. It is currently not as feature complete as the original version but it should have enough functionality to be usable.
There are a few ways to install it. The easiest way is to grab a release from here. Otherwise, you can install it from crates.io with a working Rust installation:
cargo install topngx
# If you do not have SQLite headers installed on your system, you can use the bundled feature.
cargo install topngx --features bundled-sqliteSQLite development headers are easy to get on Mac and Linux:
# On Mac.
brew install sqlite
# On Debian based Linux.
sudo apt-get update && sudo apt-get install libsqlite3-dev…Some example queries are:
# Run with the default queries and format (combined).
# Or use the --access-log and --no-follow flags if you do not want to read from standard input.
topngx 100' -f request_path bytes_sent < access.logThere is no option to filter the data but this could be added in the future. The original version allowed for automatic detection of NGINX configuration files, log file paths, and log format styles. topngx currently has command line options for these and may add this functionality in a later version.
If you find any other issues or features that may be missing, feel free to open an issue. You can also utilize logging via the env_logger crate.
# See the env_logger README for the various levels.
RUST_LOG=debug topngx < /path/to/access.logMIT
The ngxtop license can be seen here.
No open issues yet, or sync has not completed.