{"id":18656564,"url":"https://github.com/zendesk/ultragrep","last_synced_at":"2025-04-11T18:30:54.618Z","repository":{"id":6936920,"uuid":"8188322","full_name":"zendesk/ultragrep","owner":"zendesk","description":"the grep that greps the hardest.  ","archived":false,"fork":false,"pushed_at":"2023-05-01T21:57:35.000Z","size":1856,"stargazers_count":29,"open_issues_count":12,"forks_count":5,"subscribers_count":428,"default_branch":"master","last_synced_at":"2025-03-25T16:51:36.929Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zendesk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-13T21:33:51.000Z","updated_at":"2024-09-08T11:09:35.000Z","dependencies_parsed_at":"2022-08-06T20:01:02.833Z","dependency_job_id":null,"html_url":"https://github.com/zendesk/ultragrep","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Fultragrep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Fultragrep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Fultragrep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendesk%2Fultragrep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zendesk","download_url":"https://codeload.github.com/zendesk/ultragrep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248458362,"owners_count":21107063,"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":[],"created_at":"2024-11-07T07:24:02.880Z","updated_at":"2025-04-11T18:30:54.191Z","avatar_url":"https://github.com/zendesk.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"ultragrep\n=========\n\nultragrep is a grep tool, written at Zendesk, that works with multiple AND'ed\nregular expressions across multi-line requests and across multiple files.\n\n[![Build Status](https://travis-ci.org/zendesk/ultragrep.png?branch=master)](https://travis-ci.org/zendesk/ultragrep)\n\nhuh?\n====\n\nSome examples:\n\nlet's say we have a production.log request that logs like this:\n\n    Rewriting API request from /users/123.xml to /api/v1/users/123.xml\n    Processing Api::V1::UsersController#show to xml (for 99.99.99.99 at 2013-06-04 23:55:19) [GET]\n      Parameters: {\"controller\"=\u003e\"api/v1/users\", \"action\"=\u003e\"show\", \"id\"=\u003e\"123\", \"format\"=\u003e\"xml\"}\n    Filter chain halted as [:authenticate_user] rendered_or_redirected.\n    API request mode:web, subdomain:foo, lotus:no, mobile:false, time:2, account_id:68745, user:, url:https://foo.zendesk.com/api/v1/users/123.xml\n    Completed in 7ms (View: 1, DB: 0) | 401 Unauthorized [https://foo.zendesk.com/api/v1/users/123.xml]\n\nThe following ultragrep commands go like the following:\n\n    ultragrep foo.zendesk.com                 -\u003e match\n    ultragrep foo.zendesk.com frozzbozzle     -\u003e no match, foo.zendesk.com is there but frozzbozzle is not\n    utlragrep foo.zendesk.com UsersController -\u003e match, both terms were satisfied (though on different lines)\n    ultragrep api/v1/users/\\d+\\.xml           -\u003e full perl-compatible-regular-expression support\n\nSetup\n=====\n\nStore your logs in this structure:\n\n`/custom/host/name.log-\u003cdate\u003e # \u003cdate\u003e is 20130102 for 2013-01-02`\n\ndefine `/etc/ultragrep.yml`:\n\n```Yaml\ntypes:\n  app:\n    glob: \"/custom/*/production.log-*\"\n    format: \"app\"\ndefault_type: app\n```\n\nfor rails, it's highly advised to use ActiveSupport::BufferedLogger for your web requests, so as to prevent them\nfrom interleaving.  There's ways to pick out web requests from interleaved logs, but it's not pretty.\n\n\nUsage\n=====\n\n\u003c!-- copy paste ./bin/ultragrep -h result --\u003e\n```\nUsage: ultragrep [OPTIONS] [REGEXP ...]\n\nDates: all datetimes are in UTC whatever Ruby's Time.parse() accepts.\nFor example '2011-04-30 11:30:00'.\n\nOptions are:\n    -h, --help                       This text\n        --version                    Show version\n    -c, --config FILE                Config file location (default: .ultragrep.yml, ~/.ultragrep.yml, /etc/ultragrep.yml)\n    -p, --progress                   show grep progress to STDERR\n    -v, --verbose                    DEPRECATED\n    -t, --tail                       Tail requests, show matching requests as they arrive\n    -l, --type TYPE                  Search type of logs, specified in config\n        --perf                       Output just performance information\n    -d, --day DATETIME               Find requests that happened on this day\n    -b, --daysback  COUNT            Find requests from COUNT days ago to now\n    -o, --hoursback COUNT            Find requests  from COUNT hours ago to now\n    -s, --start DATETIME             Find requests starting at this date\n    -e, --end DATETIME               Find requests ending at this date\n        --host HOST                  Only find requests on this host\n    -k  --key                        Searched for a given key in a JSON logs.\n\nNote about dates: all datetimes are in UTC, and are flexibly whatever ruby's\nTime.parse() will accept.  the format '2011-04-30 11:30:00' will work just fine, if you\nneed a suggestion.\n```\n\nExamples\n========\n\nTo tail work-server logs for XYZJob\n\n```Bash\nultragrep -t -l work XYZJob\n```\n\nTo look at logs from last two days for 'host.com' and foobar\n\n```Bash\nultragrep -b 2 host.com foobar\n```\n\n## TODO\n - should not be necessary to ship pcre headers, but it's broken on OSX Mavericks\n - Search in an array , and herarical key-value  for JSON logs\n\n## Copyright and license\n\nCopyright 2013 Zendesk\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzendesk%2Fultragrep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzendesk%2Fultragrep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzendesk%2Fultragrep/lists"}