{"id":13685909,"url":"https://github.com/thecasualcoder/tztail","last_synced_at":"2025-05-01T04:32:52.112Z","repository":{"id":33259567,"uuid":"156000355","full_name":"thecasualcoder/tztail","owner":"thecasualcoder","description":"tztail (TimeZoneTAIL) allows you to view logs in the timezone you want","archived":false,"fork":false,"pushed_at":"2022-06-06T21:21:59.000Z","size":1011,"stargazers_count":231,"open_issues_count":6,"forks_count":8,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-27T00:03:14.831Z","etag":null,"topics":["rust","timezone-conversion"],"latest_commit_sha":null,"homepage":"https://thecasualcoder.github.io/tztail/","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/thecasualcoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-03T16:13:22.000Z","updated_at":"2024-01-04T15:50:43.000Z","dependencies_parsed_at":"2022-07-24T20:32:09.092Z","dependency_job_id":null,"html_url":"https://github.com/thecasualcoder/tztail","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecasualcoder%2Ftztail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecasualcoder%2Ftztail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecasualcoder%2Ftztail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecasualcoder%2Ftztail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecasualcoder","download_url":"https://codeload.github.com/thecasualcoder/tztail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224235640,"owners_count":17278198,"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":["rust","timezone-conversion"],"created_at":"2024-08-02T14:00:58.996Z","updated_at":"2024-11-12T07:32:16.648Z","avatar_url":"https://github.com/thecasualcoder.png","language":"Rust","readme":"# tztail\n\n[![Build Status](https://travis-ci.org/thecasualcoder/tztail.svg?branch=master)](https://travis-ci.org/thecasualcoder/tztail)\n[![crates.io](https://img.shields.io/crates/v/tztail.svg)](https://crates.io/crates/tztail)\n![Crates.io](https://img.shields.io/crates/d/tztail)\n\ntztail (TimeZoneTAIL) allows you to view logs in the timezone you want. Its tail with timezone.\n\n## Install\n\n_Using Homebrew_\n\n```bash\nbrew tap thecasualcoder/stable\nbrew install tztail\n```\n\n_Using Cargo_\n\n```bash\ncargo install tztail\n```\n\n## Usage\n\n```bash\n$ tztail --help\ntztail (TimeZoneTAIL) allows you to view logs in the timezone you want\n\nUSAGE:\n    tztail [FILE]\n\nOPTIONS:\n    -t, --timezone \u003cTIMEZONE\u003e    Sets the timezone in which output should be printed. (Default: local timezone)\n    -f, --follow                 Follow the file indefinitely as changes are added. (Default: Off)\n        --format \u003cFORMAT\u003e        Custom format for parsing dates. (Default: autodetected patterns)\n    -h, --help                   Prints help information\n    -V, --version                Prints version information\n\nARGS:\n    \u003cFILE\u003e    File to tail. STDIN by default\n```\n\n## Features\n\n- Supports few standard formats with which auto detection is done when parsing logs.\n- Supports specifying custom format for parsing in case it is a non-standard format. See [here](https://docs.rs/chrono/0.4.6/chrono/format/strftime/index.html#specifiers) for formats.\n- Autodetect source timezone if present in logs. Example (`2014-11-28T12:00:09+0100` is CET)\n- Output logs to local timezone by default\n\n## Demo\n\n![demo](/demo/tztail.gif)\n\n## Autodetectable formats\n\nMost used autodetectable formats\n\n| Name             | Example                         |\n| ---------------- | ------------------------------- |\n| RFC2822          | Fri, 28 Nov 2014 12:00:09 +0000 |\n| RFC3339          | 2014-11-28T12:00:09+0000        |\n| Nginx Log format | 04/Nov/2018:12:13:49 +0000      |\n\n## Usecase\n\nThis tool can be used to convert timestamps in a log to any desired timezone while tailing logs. Eg. In case your logs are in UTC and you want to view it in a different timezone say. Asia/Kolkata (IST), pipe the logs through `tztail`.\n\n```bash\n## Example usage\n$ cat somelog # A log in UTC\n2018-11-03 19:47:20.279044 I mvcc: finished scheduled compaction at 104794 (took 748.443µs)\n2018-11-03 19:52:20.282913 I mvcc: store.index: compact 105127\n\n$ cat somelog | tztail --timezone Asia/Kolkata # Timestamps converted to IST\n2018-11-04 01:17:20.279044 I mvcc: finished scheduled compaction at 104794 (took 748.443µs)\n2018-11-04 01:22:20.282913 I mvcc: store.index: compact 105127\n```\n\nIt allows to specify a custom format as well.\n\n```bash\n## Example usage\n$ cat somelog # A log in non-standard format\n2018-11-03 20:07:20 mvcc: store.index: compact 106120\n2018-11-03 20:07:20 mvcc: finished scheduled compaction at 106120 (took 933.25µs)\n\n$ cat somelog | tztail -t Asia/Kolkata --format \"%Y-%m-%d %H:%M:%S\"\n2018-11-04 01:37:20 mvcc: store.index: compact 106120\n2018-11-04 01:37:20 mvcc: finished scheduled compaction at 106120 (took 933.25µs)\n```\n\n## Building from source\n\nCheckout the code and build locally. Needs rust compiler 1.30 or above.\n\n```bash\n$ git clone https://github.com/thecasualcoder/tztail\n$ cd tztail\n\n# To build binary locally\n$ cargo build --release\n\n# To install binary locally in Cargo bin path\n$ cargo install\n\n# To run tests\n$ cargo test\n```\n","funding_links":[],"categories":["Rust","Shell"],"sub_categories":["PCAP"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecasualcoder%2Ftztail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecasualcoder%2Ftztail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecasualcoder%2Ftztail/lists"}