You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-16Lines changed: 37 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,6 @@ tztail (TimeZoneTAIL) allows you to view logs in the timezone you want.
4
4
5
5
> This project is work in progress
6
6
7
-
## Usecase
8
-
9
-
This 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`.
10
-
11
-
```bash
12
-
## Example usage
13
-
$ cat somelog # A log in UTC
14
-
2014-11-28T12:00:09+00:00 I | some log
15
-
$ tail somelog | tztail --timezone Asia/Kolkata
16
-
2014-11-28T17:30:09+05:30 I | some log # timestamps alone converted to IST
17
-
```
18
-
19
7
## Usage
20
8
21
9
```bash
@@ -27,13 +15,46 @@ USAGE:
27
15
28
16
OPTIONS:
29
17
-t, --timezone <TIMEZONE> Sets the timezone in which output should be printed
18
+
-f, --format <FORMAT> Custom format for parsing dates
30
19
-h, --help Prints help information
31
20
-V, --version Prints version information
32
21
```
33
22
34
-
It reads from _STDIN_ as of now.
23
+
## Usecase
24
+
25
+
This 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`.
26
+
27
+
```bash
28
+
## Example usage
29
+
$ cat somelog # A log in UTC
30
+
2018-11-03 19:47:20.279044 I mvcc: finished scheduled compaction at 104794 (took 748.443µs)
31
+
2018-11-03 19:52:20.282913 I mvcc: store.index: compact 105127
32
+
33
+
$ cat somelog | tztail --timezone Asia/Kolkata # Timestamps converted to IST
34
+
2018-11-04 01:17:20.279044 I mvcc: finished scheduled compaction at 104794 (took 748.443µs)
35
+
2018-11-04 01:22:20.282913 I mvcc: store.index: compact 105127
2018-11-04 01:37:20 mvcc: finished scheduled compaction at 106120 (took 933.25µs)
49
+
```
50
+
51
+
## Features
52
+
53
+
- It reads from _STDIN_ as of now.
54
+
- Supports few standard formats with which auto detection is done when parsing logs.
55
+
- 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.
0 commit comments