{"id":13631918,"url":"https://github.com/gsquire/topngx","last_synced_at":"2025-05-16T09:02:45.958Z","repository":{"id":57670180,"uuid":"270808394","full_name":"gsquire/topngx","owner":"gsquire","description":"top for NGINX","archived":false,"fork":false,"pushed_at":"2025-04-05T18:38:39.000Z","size":60,"stargazers_count":693,"open_issues_count":0,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-09T03:14:07.274Z","etag":null,"topics":["command-line","nginx","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/topngx","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gsquire.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-08T19:59:51.000Z","updated_at":"2025-04-05T18:38:43.000Z","dependencies_parsed_at":"2022-09-26T20:40:47.748Z","dependency_job_id":null,"html_url":"https://github.com/gsquire/topngx","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsquire%2Ftopngx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsquire%2Ftopngx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsquire%2Ftopngx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gsquire%2Ftopngx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gsquire","download_url":"https://codeload.github.com/gsquire/topngx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253553037,"owners_count":21926591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","nginx","rust"],"created_at":"2024-08-01T22:02:44.100Z","updated_at":"2025-05-16T09:02:45.426Z","avatar_url":"https://github.com/gsquire.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# topngx\n[![CI](https://github.com/gsquire/topngx/workflows/CI/badge.svg)](https://github.com/gsquire/topngx/actions)\n\nThis tool is a rewrite of [ngxtop](https://github.com/lebinh/ngxtop) to make it easier to install\nand hopefully run faster. For those unfamiliar with the ngxtop, it is a tool that helps you\nparse NGINX access logs and print various statistics from them regardless of format. It is\ncurrently not as feature complete as the original version but it should have enough functionality\nto be usable.\n\n![screenshot](screenshot.png)\n\n## Installation\nThere are a few ways to install it. The easiest way is to grab a release from [here](https://github.com/gsquire/topngx/releases).\nOtherwise, you can install it from [crates.io](https://crates.io/crates/topngx) with a working Rust\ninstallation:\n\n```sh\ncargo install topngx\n\n# If you do not have SQLite headers installed on your system, you can use the bundled feature.\ncargo install topngx --features bundled-sqlite\n```\n\nSQLite development headers are easy to get on Mac and Linux:\n\n```sh\n# On Mac.\nbrew install sqlite\n\n# On Debian based Linux.\nsudo apt-get update \u0026\u0026 sudo apt-get install libsqlite3-dev\n```\n\n## CHANGELOG\n[See here](CHANGELOG.md)\n\n## Usage\n```sh\ntopngx 0.3.0\nGarrett Squire \u003cgithub@garrettsquire.com\u003e\ntop for NGINX\n\nUSAGE:\n    topngx [FLAGS] [OPTIONS] [SUBCOMMAND]\n\nFLAGS:\n    -t, --follow     Tail the specified log file. You cannot tail standard input\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -a, --access-log \u003caccess-log\u003e    The access log to parse\n    -f, --format \u003cformat\u003e            The specific log format with which to parse [default: combined]\n    -g, --group-by \u003cgroup-by\u003e        Group by this variable [default: request_path]\n    -w, --having \u003chaving\u003e            Having clause [default: 1]\n    -i, --interval \u003cinterval\u003e        Refresh the statistics using this interval which is given in seconds [default: 2]\n    -l, --limit \u003climit\u003e              The number of records to limit for each query [default: 10]\n    -o, --order-by \u003corder-by\u003e        Order of output for the default queries [default: count]\n\nSUBCOMMANDS:\n    avg      Print the average of the given fields\n    help     Prints this message or the help of the given subcommand(s)\n    info     List the available fields as well as the access log and format being used\n    print    Print out the supplied fields with the given limit\n    query    Supply a custom query\n    sum      Compute the sum of the given fields\n    top      Find the top values for the given fields\n```\n\nSome example queries are:\n\n```sh\n# Run with the default queries and format (combined).\n# Or use the --access-log and --no-follow flags if you do not want to read from standard input.\ntopngx \u003c /path/to/access.log\n\n# Output:\ncount  avg_bytes_sent  2XX  3XX  4XX  5XX\n2      346.5           2    0    0    0\nrequest_path              count  avg_bytes_sent  2XX  3XX  4XX  5XX\nGET / HTTP/1.1            1      612             1    0    0    0\nGET /some_file1 HTTP/1.1  1      81              1    0    0    0\n\n# See the fields that you can use for queries.\ntopngx info \u003c access.log\n\n# Use a custom log format.\ntopngx -f '$remote_addr - $remote_user [$time_local] \"$request\" $status $bytes_sent' info\n\n# Output:\naccess log file: STDIN\naccess log format: $remote_addr - $remote_user [$time_local] \"$request\" $status $bytes_sent\navailable variables to query: remote_addr, remote_user, time_local, request_path, status_type, bytes_sent\n\n# Run a custom query.\n# The fields passed in can be viewed via the info sub command.\ntopngx query -q 'select * from log where bytes_sent \u003e 100' -f request_path bytes_sent \u003c access.log\n```\n\n## Limitations\nThere is no option to filter the data but this could be added in the future. The original version\nallowed for automatic detection of NGINX configuration files, log file paths, and log format styles.\ntopngx currently has command line options for these and may add this functionality in a later version.\n\nIf you find any other issues or features that may be missing, feel free to open an issue. You can\nalso utilize logging via the [env_logger](https://github.com/sebasmagri/env_logger/) crate.\n\n```sh\n# See the env_logger README for the various levels.\nRUST_LOG=debug topngx \u003c /path/to/access.log\n```\n\n## License\nMIT\n\nThe ngxtop license can be seen [here](https://github.com/lebinh/ngxtop/blob/master/LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsquire%2Ftopngx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgsquire%2Ftopngx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsquire%2Ftopngx/lists"}