{"id":19196020,"url":"https://github.com/acj/timescan","last_synced_at":"2025-02-23T04:43:03.157Z","repository":{"id":195522506,"uuid":"693115644","full_name":"acj/timescan","owner":"acj","description":"Find timestamps in a string or stream of bytes","archived":false,"fork":false,"pushed_at":"2023-09-18T11:59:27.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-05T00:47:38.979Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/acj.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}},"created_at":"2023-09-18T11:34:49.000Z","updated_at":"2023-09-18T11:45:44.000Z","dependencies_parsed_at":"2023-09-18T12:14:52.312Z","dependency_job_id":null,"html_url":"https://github.com/acj/timescan","commit_stats":null,"previous_names":["acj/timescan"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acj%2Ftimescan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acj%2Ftimescan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acj%2Ftimescan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acj%2Ftimescan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acj","download_url":"https://codeload.github.com/acj/timescan/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240271519,"owners_count":19774859,"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-09T12:12:14.969Z","updated_at":"2025-02-23T04:43:03.125Z","avatar_url":"https://github.com/acj.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# timescan\n\nA Rust crate for finding timestamps in a string or stream of bytes\n\n## Examples\n\nFind a timestamp in a string:\n\n```\nuse timescan::TimestampFinder;\nlet date_finder = TimestampFinder::new().unwrap();\nlet log = \"Nov 23 06:26:40 ip-10-1-26-81 haproxy[20128]: 10.1.1.105:57305 [23/Nov/2019:06:26:40.781] public myapp/i-05fa49c0e7db8c328 0/0/0/78/78 206 913/458 - - ---- 9/9/6/0/0 0/0 {bytes=0-0} {||1|bytes 0-0/499704} \\\"GET /2518cb13a48bdf53b2f936f44e7042a3cc7baa06 HTTP/1.1\\\"\";\nlet timestamp = date_finder.find_timestamp(log).unwrap();\n```\n\nFind all timestamps by consuming a reader:\n\n```\nuse timescan::TimestampFinder;\nlet log = \"Nov 23 06:26:40 ip-10-1-1-1 haproxy[20128]: 10.1.1.10:57305 [23/Nov/2019:06:26:40.781] public myapp/i-05fa49c0e7db8c328 0/0/0/78/78 206 913/458 - - ---- 9/9/6/0/0 0/0 {bytes=0-0} {||1|bytes 0-0/499704} \\\"GET /2518cb13a48bdf53b2f936f44e7042a3cc7baa06 HTTP/1.1\\\"\nNov 23 06:26:41 ip-10-1-1-1 haproxy[20128]: 10.1.1.11:51819 [23/Nov/2019:06:27:41.780] public myapp/i-059c225b48702964a 0/0/0/80/80 200 802/142190 - - ---- 8/8/5/0/0 0/0 {} {||141752|} \\\"GET /2043f2eb9e2691edcc0c8084d1ffce8bd70bc6e7 HTTP/1.1\\\"\nNov 23 06:26:42 ip-10-1-1-1 haproxy[20128]: 10.1.1.12:38870 [23/Nov/2019:06:28:42.773] public myapp/i-048088fd46abe7ed0 0/0/0/77/100 200 823/512174 - - ---- 8/8/5/0/0 0/0 {} {||511736|} \\\"GET /eb59c0b5dad36f080f3d261c6257ce0e21ef1a01 HTTP/1.1\\\"\n\";\nlet date_finder = TimestampFinder::new().unwrap();\nlet timestamps = date_finder.scan(log.as_bytes()).unwrap();\n```\n\n## How it works\n\ntimescan converts a time format string like `%d/%b/%Y:%H:%M:%S%.f` into a regular expression that can efficiently locate timestamps in strings. It then converts those matched substrings into unix timestamps (integers) and returns them to you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facj%2Ftimescan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facj%2Ftimescan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facj%2Ftimescan/lists"}