aboutsummaryrefslogtreecommitdiff
path: root/addts.1
blob: fce0eb3bdefbf2418f72cd603b3a61ae0619000c (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
.TH ADDTS 1 "June 22, 2018" 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).
.SH AUTHORS 
Sergey Poznyakoff <gray@gnu.org.ua>.
.SH COPYRIGHT
Copyright \(co 2018 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.