{"id":19032483,"url":"https://github.com/creadone/ngx","last_synced_at":"2026-05-16T00:31:57.611Z","repository":{"id":70234263,"uuid":"310216832","full_name":"creadone/ngx","owner":"creadone","description":"NGINX access log parser and filter by fields or values with output to JSON or plain text","archived":false,"fork":false,"pushed_at":"2020-11-05T07:13:17.000Z","size":4,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-02T04:26:56.016Z","etag":null,"topics":["crystal","logs","nginx","parser"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/creadone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-05T07:06:34.000Z","updated_at":"2023-03-05T00:55:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce4da4b2-8481-4c79-8e61-5fa07436c26b","html_url":"https://github.com/creadone/ngx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creadone%2Fngx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creadone%2Fngx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creadone%2Fngx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creadone%2Fngx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creadone","download_url":"https://codeload.github.com/creadone/ngx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240082640,"owners_count":19745257,"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":["crystal","logs","nginx","parser"],"created_at":"2024-11-08T21:28:49.995Z","updated_at":"2026-05-03T16:30:17.688Z","avatar_url":"https://github.com/creadone.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NGX\n\nCLI tool for parsing NGINX access log and filtering by fields or values with output to JSON or plain text\n\n## Status\n\nPre-alpha, don't use on production.\n\n## Installation\n\n`git clone https://github.com/creadone/ngx \u0026\u0026 cd ngx \u0026\u0026 shards build --release`\n\n## Usage\n\nThe main difference between the `filter` and `find` that the `filter` returns only subset of the fields and nothing more, and the `find` can compare by value of fields but always returns all fields.\n\n### Finder mode\n\n**Fields**\n\nip, user, day, month, year, hour, minute, second, timezone, method, path, protocol, version, code, bytes, referer, user_agent\n\n**Input logs**\n```\n127.0.0.1 - - [30/Oct/2020:10:27:00 +0000] \"GET / HTTP/1.1\" 200 0 \"-\" \"ApacheBench/2.3\"\n127.0.0.1 - - [30/Oct/2020:10:27:00 +0000] \"GET / HTTP/1.1\" 200 0 \"-\" \"ApacheBench/2.3\"\n127.0.0.1 - - [30/Oct/2020:10:27:00 +0000] \"GET / HTTP/1.1\" 200 0 \"-\" \"ApacheBench/2.3\"\n```\n\n**Run ngx**\n```sh\ncat access.log | ngx -m find -f ip=127.0.0.1, method=GET -o json\n```\n\n**Output**\n```\n{\"ip\":\"127.0.0.1\",\"user\":\"-\",\"day\":\"30\",\"month\":\"Oct\",\"year\":\"2020\",\"hour\":\"10\",\"minute\":\"27\",\"second\":\"00\",\"timezone\":\"+0000\",\"method\":\"GET\",\"path\":\"/\",\"protocol\":\"HTTP\",\"version\":\"1.1\",\"code\":\"200\",\"bytes\":\"2205\",\"referer\":\"-\",\"user_agent\":\"ApacheBench/2.3\"}\n{\"ip\":\"127.0.0.1\",\"user\":\"-\",\"day\":\"30\",\"month\":\"Oct\",\"year\":\"2020\",\"hour\":\"10\",\"minute\":\"27\",\"second\":\"00\",\"timezone\":\"+0000\",\"method\":\"GET\",\"path\":\"/\",\"protocol\":\"HTTP\",\"version\":\"1.1\",\"code\":\"200\",\"bytes\":\"2205\",\"referer\":\"-\",\"user_agent\":\"ApacheBench/2.3\"}\n{\"ip\":\"127.0.0.1\",\"user\":\"-\",\"day\":\"30\",\"month\":\"Oct\",\"year\":\"2020\",\"hour\":\"10\",\"minute\":\"27\",\"second\":\"00\",\"timezone\":\"+0000\",\"method\":\"GET\",\"path\":\"/\",\"protocol\":\"HTTP\",\"version\":\"1.1\",\"code\":\"200\",\"bytes\":\"2205\",\"referer\":\"-\",\"user_agent\":\"ApacheBench/2.3\"}\n```\n\n### Filter mode\n\n**Input logs**\n```\n127.0.0.1 - - [30/Oct/2020:10:27:00 +0000] \"GET / HTTP/1.1\" 200 0 \"-\" \"ApacheBench/2.3\"\n127.0.0.1 - - [30/Oct/2020:10:27:00 +0000] \"GET / HTTP/1.1\" 200 0 \"-\" \"ApacheBench/2.3\"\n127.0.0.1 - - [30/Oct/2020:10:27:00 +0000] \"GET / HTTP/1.1\" 200 0 \"-\" \"ApacheBench/2.3\"\n```\n\n**Run ngx**\n```sh\ncar access.log | ngx -m filter -f ip,method,path -o json\n```\n\n**Output**\n```\n{\"ip\":\"127.0.0.1\",\"method\":\"GET\",\"path\":\"/\"}\n{\"ip\":\"127.0.0.1\",\"method\":\"GET\",\"path\":\"/\"}\n{\"ip\":\"127.0.0.1\",\"method\":\"GET\",\"path\":\"/\"}\n{\"ip\":\"127.0.0.1\",\"method\":\"GET\",\"path\":\"/\"}\n```\n\n## TODO\n\n1. Tests\n2. Merge `finder` and `filter` into one\n3. Custom parsing templates\n4. Add expressions to comparison: `cat access.log | ngx -m find -f code \u003e 400, ip \u003c\u003c 127.0.0.1/24 -o json`\n5. Export output with TCP or HTTP\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/creadone/ngx/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Sergey Fedorov](https://github.com/creadone) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreadone%2Fngx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreadone%2Fngx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreadone%2Fngx/lists"}