diff options
Diffstat (limited to 'mlog.1')
-rw-r--r-- | mlog.1 | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/mlog.1 b/mlog.1 new file mode 100644 index 0000000..edbd3a9 --- /dev/null +++ b/mlog.1 @@ -0,0 +1,64 @@ +.Dd January 12, 2024 +.Dt MLOG 1 +.Os +.Sh NAME +.Nm mlog +.Nd merge log files by timestamp +.Sh SYNOPSIS +.Nm +.Op Fl f +.Op Fl s +.Op Fl u +.Op Ar files\ ... +.Sh DESCRIPTION +.Nm +reads lines from multiple log files and prints them in chronological order. +The files need to start with comparable timestamps. +.Nm +prints the oldest line first, thus preserving relative order. +.Pp +.Nm +behaves like a combination of +.Ql sort -m +and +.Ql tail -f . +.Pp +The options are as follows: +.Bl -tag -width Ds +.It Fl f +Follow the output files, output appended lines as file grows. +When the file is truncated or recreated, start from beginning. +With two +.Fl f +flags, seek to the end of files on start and only print fresh lines. +.It Fl s +Strip a prefix generated by +.Xr socklog 8 +from each line, which have a format like +.Ql Ar facility Ns \&. Ns Ar priority Ns \&: Ar timestamp . +.It Fl u +Only print unique lines. +If other files contain the same line at the current position, skip them. +.El +.Sh EXIT STATUS +.Ex -std +.Sh INTERNALS +On Linux, +.Xr inotify 7 +is used to detect file changes. +.Sh SEE ALSO +.Xr tail 1 , +.Xr sort 1 , +.Xr svlogd 8 +.Sh AUTHORS +.An Leah Neukirchen Aq Mt leah@vuxu.org +.Sh LICENSE +.Nm +is in the public domain. +.Pp +To the extent possible under law, +the creator of this work +has waived all copyright and related or +neighboring rights to this work. +.Pp +.Lk http://creativecommons.org/publicdomain/zero/1.0/ |