{"id":13575366,"url":"https://github.com/abbat/timegrep","last_synced_at":"2025-04-04T22:30:52.920Z","repository":{"id":147505942,"uuid":"111296280","full_name":"abbat/timegrep","owner":"abbat","description":"Utility to grep log between two dates or tail last lines to time ago.","archived":false,"fork":false,"pushed_at":"2022-10-25T16:29:08.000Z","size":42,"stargazers_count":9,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-05T11:42:15.041Z","etag":null,"topics":["date","grep","log","tail","time"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abbat.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-11-19T13:10:34.000Z","updated_at":"2024-04-23T13:23:37.000Z","dependencies_parsed_at":"2023-05-03T01:31:51.803Z","dependency_job_id":null,"html_url":"https://github.com/abbat/timegrep","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbat%2Ftimegrep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbat%2Ftimegrep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbat%2Ftimegrep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbat%2Ftimegrep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abbat","download_url":"https://codeload.github.com/abbat/timegrep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247260354,"owners_count":20909994,"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":["date","grep","log","tail","time"],"created_at":"2024-08-01T15:01:00.356Z","updated_at":"2025-04-04T22:30:49.697Z","avatar_url":"https://github.com/abbat.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# timegrep\n\nUtility to grep log between two dates or tail last lines to time ago similar [dategrep](https://github.com/mdom/dategrep) or [dateutils](https://github.com/hroptatyr/dateutils).\n\n## Examples\n\nGrep last minute from current nginx access log (binary search):\n\n```\n$ timegrep --format=nginx --minutes=1 /var/log/nginx/access.log\n```\n\nGrep datetime interval from archive log (sequential read data from `stdin`):\n\n```\n$ zcat archive.log.gz | timegrep --start='2017:09:01 15:23:00' --stop='2017:09:01 16:32:00'\n```\n\n## Download / Install\n\n* [Precompiled static binaries](https://github.com/abbat/timegrep/releases) built with system libc (glibc) and musl libc for x64 and i386\n* From source code:\n\n```\n$ git clone https://github.com/abbat/timegrep.git\n$ make \u0026\u0026 sudo make install\n```\n\nTo compile with own flags use `USER_CFLAGS` and `USER_LDFLAGS` variables. For example for i386 static binary with [musl libc](https://www.musl-libc.org):\n\n```\n$ CC=musl-gcc32 USER_CFLAGS=-m32 USER_LDFLAGS='-L/usr/lib/i386-linux-gnu -m32 -static -Wl,-melf_i386' make\n```\n\n## Usage\n\n```\ntimegrep [options] [files]\n```\n\n**Options**\n\n* `--help`, `-?` - print help message and named datetime formats;\n* `--version`, `-v` - print program version and exit;\n* `--format`, `-e` - datetime format (default: 'default');\n* `--start`, `-f` - datetime to start search (default: now);\n* `--stop`, `-t` - datetime to stop search (default: now);\n* `--seconds`, `-s` - seconds to substract from `--start` (default: 0);\n* `--minutes`, `-m` - minutes to substract from `--start` (default: 0);\n* `--hours`, `-h` - hours to substract from `--start` (default: 0).\n\nSee [strptime(3)](https://linux.die.net/man/3/strptime) for format details. See `--help` for list of format aliases.\n\n## Exit code\n\n* `0` - successful completion;\n* `1` - nothing found;\n* `2` - general application error.\n\n## How to help\n\n* Translate this document or [man page](https://github.com/abbat/timegrep/blob/master/timegrep.1) to your native language;\n* Proofreading README.md or man page with your native language;\n* Share, Like, RT to your friends;\n* Send PRs if you are developer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabbat%2Ftimegrep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabbat%2Ftimegrep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabbat%2Ftimegrep/lists"}