aboutsummaryrefslogtreecommitdiff
path: root/addts.1
blob: 1bba4a7501047baf3cd6fb0449353aae53c85290 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
.\" This file is part of addts -*- nroff -*-
.\" Copyright (C) 2018, 2019 Sergey Poznyakoff
.\" 
.\" Addts is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 3, or (at your option)
.\" any later version.
.\" 
.\" Addts is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\" 
.\" You should have received a copy of the GNU General Public License
.\" along with addts.  If not, see <http://www.gnu.org/licenses/>.
.TH ADDTS 1 "July 31, 2019" ADDTS "User Commands"
.SH NAME
addts \- add timestamps at the beginning of each line
.SH SYNOPSIS
.nh
.na
\fBaddts\fR\
 [\fB\-asu\fR]\
 [\fB\-f \fIFMT\fR]\
 [\fB\-w \fICHR\fR]\
 [\fIFILE\fR]
.PP
\fBaddts\fR \fB\-?\fR
.ad
.hy
.SH DESCRIPTION
Reads standard input and writes it to standard output, adding a
timestamp at the begginning (or end) of each line. If \fIFILE\fR is suppied,
writes to it instead. Typical usage is for Apache forensic log:
.PP
.EX
ForensicLog "|/usr/bin/addts -a /var/log/httpd/forensic.log"
.EE
.PP
To add timestamps to the end of each line, formatting it as an
additional header:
.PP
.EX
ForensicLog "|/usr/bin/addts -a -s -f '|X-TS:%c' /var/log/httpd/forensic.log"
.EE
.SH OPTIONS
.TP
.B \-a
Append to \fIFILE\fR. Without this option, \fIFILE\fR is truncated
after opening.
.TP
.BI \-f " FMT"
Define timestamp format. \fIFMT\fR is a
.BR strftime (3)
format string, with an additional format conversion specifier
.BR %@ ,
which is replaced with micronseconds.
.sp
See also \fB\-w\fR, below.
.TP
.B \-s
Add timestamp to the end of each line (suffix mode).
.TP
.B \-u
Report times in UTC.
.TP
.BI \-w " CHR"
Replace each occurrense of character \fICHR\fR in format string with
single whitespace. Use this option if your Apache version is unable to
correctly process quoted arguments in the \fBForensicLog\fR statement.
Example usage (newlines added for readability):
.sp
.EX
ForensicLog "|/usr/bin/addts -w_ -f %Y-%m-%d_%H:%M:%S.%@:_ \\
              -a /var/log/httpd/forensic.log"
.EE
.SH BUGS
Formatted timestamp cannot be longer than 511 bytes.
.PP
Empty lines are left unchanged (no timestamp added). 
.SH "SEE ALSO"
.BR strftime (3).
.\" The MANCGI variable is set by man.cgi script on Ulysses.
.\" The download.inc file contains the default DOWNLOAD section
.\" for man-based doc pages.
.if "\V[MANCGI]"WEBDOC" \{\
.       ds package addts
.       ds version 1.0
.       so download.inc
\}
.SH AUTHORS 
Sergey Poznyakoff <gray@gnu.org.ua>.
.SH COPYRIGHT
Copyright \(co 2018, 2019 Sergey Poznyakoff
.br
.na
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
.br
.ad
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.\" Local variables:
.\" eval: (add-hook 'write-file-hooks 'time-stamp)
.\" time-stamp-start: ".TH [A-Z_][A-Z0-9_.\\-]* [0-9] \""
.\" time-stamp-format: "%:B %:d, %:y"
.\" time-stamp-end: "\""
.\" time-stamp-line-limit: 20
.\" end:

Return to:

Send suggestions and report system problems to the System administrator.