topngx
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.
Installation
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:
# If you do not have SQLite headers installed on your system, you can use the bundled feature.
SQLite development headers are easy to get on Mac and Linux:
# On Mac.
# On Debian based Linux.
&&
CHANGELOG
Usage
)
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.
# Output:
# See the fields that you can use for queries.
# Use a custom log format.
# Output:
# Run a custom query.
# The fields passed in can be viewed via the info sub command.
Limitations
There 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
License
MIT
The ngxtop license can be seen here.