File tree Expand file tree Collapse file tree 2 files changed +37
-3
lines changed
Expand file tree Collapse file tree 2 files changed +37
-3
lines changed Original file line number Diff line number Diff line change 11# chronox
2- A simple Rust utility to convert log files to UTC 🦀
2+ A simple Rust utility to convert log files from local time to UTC 🦀.
3+
4+
5+ It takes dates in ` Month Day HH:MM:SS ` format and converts it to ` YYYY-MM-DD HH:MM:SS Z ` format.
6+
7+ For example using a -06:00 offset:
8+
9+ ```
10+ Aug 27 00:00:00 host systemd[1]: Reloaded httpd.service - The Apache HTTP Server.
11+ ```
12+
13+ Gets converted to:
14+ ```
15+ 2023-08-27 06:00:00 UTC host systemd[1]: Reloaded httpd.service - The Apache HTTP Server.
16+ ```
17+
18+ # Usage
19+ ` chronox ` can be used from the command line with the following syntax:
20+
21+ ``` bash
22+ chronox [logfile] [timezone offset]
23+ ```
24+
25+ The timezone offset needs to be in ` -+00:00 ` format.
26+
27+ A file with the suffix ` -chronox ` will be saved in the same directory as the original file.
28+
29+ # Downloading
30+
31+ Grab one of the binaries from the [ releases page] ( ) .
32+
33+ # Gotchas
34+
35+ * The utility assumes the year is current year.
36+ * Only files that use ` Month Day HH:MM:SS ` format would work (Like ` messages ` or ` syslog ` ).
Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ fn get_time_utc(date_str: String) -> DateTime<Utc> {
2424}
2525
2626fn print_usage ( ) {
27- println ! ( "Usage: <filename> <timezone offset in +-06:00 format>" ) ;
28- println ! ( "Converts log time entries to UTC time " ) ;
27+ println ! ( "Usage: ./chronox <filename> <timezone offset in +-06:00 format>" ) ;
28+ println ! ( "Converts log time entries to UTC" ) ;
2929 println ! ( "Example: ./chronox messages -06:00" ) ;
3030}
3131
You can’t perform that action at this time.
0 commit comments