systemd/man/systemd-journal-upload.8
2015-02-17 11:22:16 +01:00

202 lines
6.0 KiB
Groff

'\" t
.TH "SYSTEMD\-JOURNAL\-UPLOAD" "8" "" "systemd 219" "systemd-journal-upload"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
systemd-journal-upload \- Send journal messages over the network
.SH "SYNOPSIS"
.HP \w'\fBsystemd\-journal\-upload\fR\ 'u
\fBsystemd\-journal\-upload\fR [OPTIONS...] [\-u/\-\-url=\fIURL\fR] [SOURCES...]
.SH "DESCRIPTION"
.PP
\fBsystemd\-journal\-upload\fR
will upload journal entries to the URL specified with
\fB\-\-url\fR\&. Unless limited by one of the options specified below, all journal entries accessible to the user the program is running as will be uploaded, and then the program will wait and send new entries as they become available\&.
.SH "OPTIONS"
.PP
\fB\-u\fR, \fB\-\-url=\fR\fB[https://]\fR\fB\fIURL\fR\fR, \fB\-\-url=\fR\fB[http://]\fR\fB\fIURL\fR\fR
.RS 4
Upload to the specified address\&.
\fIURL\fR
may specify either just the hostname or both the protocol and hostname\&.
\fBhttps\fR
is the default\&.
.RE
.PP
\fB\-\-system\fR, \fB\-\-user\fR
.RS 4
Limit uploaded entries to entries from system services and the kernel, or to entries from services of current user\&. This has the same meaning as
\fB\-\-system\fR
and
\fB\-\-user\fR
options for
\fBjournalctl\fR(1)\&. If neither is specified, all accessible entries are uploaded\&.
.RE
.PP
\fB\-m\fR, \fB\-\-merge\fR
.RS 4
Upload entries interleaved from all available journals, including other machines\&. This has the same meaning as
\fB\-\-merge\fR
option for
\fBjournalctl\fR(1)\&.
.RE
.PP
\fB\-D\fR, \fB\-\-directory=\fR\fB\fIDIR\fR\fR
.RS 4
Takes a directory path as argument\&. Upload entries from the specified journal directory
\fIDIR\fR
instead of the default runtime and system journal paths\&. This has the same meaning as
\fB\-\-directory\fR
option for
\fBjournalctl\fR(1)\&.
.RE
.PP
\fB\-\-file=\fR\fB\fIGLOB\fR\fR
.RS 4
Takes a file glob as an argument\&. Upload entries from the specified journal files matching
\fIGLOB\fR
instead of the default runtime and system journal paths\&. May be specified multiple times, in which case files will be suitably interleaved\&. This has the same meaning as
\fB\-\-file\fR
option for
\fBjournalctl\fR(1)\&.
.RE
.PP
\fB\-\-cursor=\fR
.RS 4
Upload entries from the location in the journal specified by the passed cursor\&. This has the same meaning as
\fB\-\-cursor\fR
option for
\fBjournalctl\fR(1)\&.
.RE
.PP
\fB\-\-after\-cursor=\fR
.RS 4
Upload entries from the location in the journal
\fIafter\fR
the location specified by the this cursor\&. This has the same meaning as
\fB\-\-after\-cursor\fR
option for
\fBjournalctl\fR(1)\&.
.RE
.PP
\fB\-\-save\-state\fR[=\fIPATH\fR]
.RS 4
Upload entries from the location in the journal
\fIafter\fR
the location specified by the cursor saved in file at
\fIPATH\fR
(/var/lib/systemd/journal\-upload/state
by default)\&. After an entry is successfully uploaded, update this file with the cursor of that entry\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Print a short help text and exit\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Print a short version string and exit\&.
.RE
.SH "EXIT STATUS"
.PP
On success, 0 is returned; otherwise, a non\-zero failure code is returned\&.
.SH "EXAMPLES"
.PP
\fBExample\ \&1.\ \&Setting up certificates for authentication\fR
.PP
Certificates signed by a trusted authority are used to verify that the server to which messages are uploaded is legitimate, and vice versa, that the client is trusted\&.
.PP
A suitable set of certificates can be generated with
\fBopenssl\fR:
.sp
.if n \{\
.RS 4
.\}
.nf
openssl req \-newkey rsa:2048 \-days 3650 \-x509 \-nodes \e
\-out ca\&.pem \-keyout ca\&.key \-subj \*(Aq/CN=Certificate authority/\*(Aq
cat >ca\&.conf <<EOF
[ ca ]
default_ca = this
[ this ]
new_certs_dir = \&.
certificate = ca\&.pem
database = \&./index
private_key = ca\&.key
serial = \&./serial
default_days = 3650
default_md = default
policy = policy_anything
[ policy_anything ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
EOF
touch index
echo 0001 > serial
SERVER=server
CLIENT=client
openssl req \-newkey rsa:1024 \-nodes \-out $SERVER\&.csr \-keyout $SERVER\&.key \-subj "/CN=$SERVER/"
openssl ca \-batch \-config ca\&.conf \-notext \-in $SERVER\&.csr \-out $SERVER\&.pem
openssl req \-newkey rsa:1024 \-nodes \-out $CLIENT\&.csr \-keyout $CLIENT\&.key \-subj "/CN=$CLIENT/"
openssl ca \-batch \-config ca\&.conf \-notext \-in $CLIENT\&.csr \-out $CLIENT\&.pem
.fi
.if n \{\
.RE
.\}
.PP
Generated files
ca\&.pem,
server\&.pem, and
server\&.key
should be installed on server, and
ca\&.pem,
client\&.pem, and
client\&.key
on the client\&. The location of those files can be specified using
\fITrustedCertificateFile=\fR,
\fIServerCertificateFile=\fR,
\fIServerKeyFile=\fR, in
/etc/systemd/journal\-remote\&.conf
and
/etc/systemd/journal\-upload\&.conf
respectively\&. The default locations can be queried by using
\fBsystemd\-journal\-remote \-\-help\fR
and
\fBsystemd\-journal\-upload \-\-help\fR\&.
.SH "SEE ALSO"
.PP
\fBsystemd-journal-remote\fR(8),
\fBjournalctl\fR(1),
\fBsystemd-journald.service\fR(8),
\fBsystemd-journal-gatewayd.service\fR(8)