https://github.com/m-messiah/timedtail
Tail logs by timestamps
https://github.com/m-messiah/timedtail
logs tail timestamp
Last synced: 5 months ago
JSON representation
Tail logs by timestamps
- Host: GitHub
- URL: https://github.com/m-messiah/timedtail
- Owner: m-messiah
- Created: 2019-02-10T11:25:26.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2022-02-03T11:31:54.000Z (over 4 years ago)
- Last Synced: 2025-02-14T05:30:00.446Z (over 1 year ago)
- Topics: logs, tail, timestamp
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# timedtail
[](https://github.com/m-messiah/timedtail/releases)
[](https://travis-ci.org/m-messiah/timedtail)
[](https://codeclimate.com/repos/5c600a617c358f028700122a/maintainability)
Tail logs by timestamps
## Usage
```
Usage: timedtail [options] ...
-b int
From which datetime start to operate seconds of the
-j int
Max number of junk lines to read (default 500)
-n int
Delta time count from now() to look at from the end of the (default 300)
-r string
Regexp to pick timestamp from string ($1 must select timestamp)
-t string
Timestamp type (default "common")
-utc
Parse timestamps as they are in UTC timezone, not local.
```
## Examples
1. Show last minute from several nginx logs ```timedtail -n 60 /var/log/nginx/app1/access.log /var/log/nginx/app2/access.log```
2. Show five minutes before unixtime from postgresql.log (log is multilines, so we use junk lines setting for skip non-timed lines) ```timedtail -t postgres -n 300 -b 1549800882 -j 10000 /var/log/postgresql/postgresql-9.6-data.log```
3. Show last five seconds from custom.log ```timedtail -r '(\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d)' -n 5 /var/log/my_supper_app.log```
## Install
Just download required binary from GitHub Releases somewhere to $PATH
## Compile
If you want to compile by yourself use:
```
git clone https://github.com/m-messiah/timedtail.git && go get && go build
```