Linux "systemd-journal-upload" Command Line Options and Examples
Send journal messages over the network

systemd-journal-upload will upload journal entries to the URL specified with --url. 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..


Usage:

systemd-journal-upload [OPTIONS...] [-u/--url=URL] [SOURCES...]






Command Line Options:

-u
Upload to the specified address. URL may specify either just the hostname or both the protocol andhostname. https is the default.
systemd-journal-upload -u ...
--system
Limit uploaded entries to entries from system services and the kernel, or to entries from services ofcurrent user. This has the same meaning as --system and --user options for journalctl(1). If neither isspecified, all accessible entries are uploaded.
systemd-journal-upload --system ...
-m
Upload entries interleaved from all available journals, including other machines. This has the samemeaning as --merge option for journalctl(1).
systemd-journal-upload -m ...
-D
Takes a directory path as argument. Upload entries from the specified journal directory DIR instead of thedefault runtime and system journal paths. This has the same meaning as --directory option forjournalctl(1).
systemd-journal-upload -D ...
--file
Takes a file glob as an argument. Upload entries from the specified journal files matching GLOB instead ofthe default runtime and system journal paths. May be specified multiple times, in which case files will besuitably interleaved. This has the same meaning as --file option for journalctl(1).
systemd-journal-upload --file ...
--cursor
Upload entries from the location in the journal specified by the passed cursor. This has the same meaningas --cursor option for journalctl(1).
systemd-journal-upload --cursor ...
--after-cursor
Upload entries from the location in the journal after the location specified by the this cursor. This hasthe same meaning as --after-cursor option for journalctl(1).
systemd-journal-upload --after-cursor ...
--save-state[
Upload entries from the location in the journal after the location specified by the cursor saved in fileat PATH (/var/lib/systemd/journal-upload/state by default). After an entry is successfully uploaded,update this file with the cursor of that entry.
systemd-journal-upload --save-state[ ...
--follow[
If set to yes, then systemd-journal-upload waits for input.
systemd-journal-upload --follow[ ...
--key
Takes a path to a SSL key file in PEM format. Defaults to /etc/ssl/private/journal-upload.pem.
systemd-journal-upload --key ...
--cert
Takes a path to a SSL certificate file in PEM format. Defaults to /etc/ssl/certs/journal-upload.pem.
systemd-journal-upload --cert ...
--trust
Takes a path to a SSL CA certificate file in PEM format, or all. If all is set, then certificate checkingwill be disabled. Defaults to /etc/ssl/ca/trusted.pem.
systemd-journal-upload --trust ...
-h
Print a short help text and exit.
systemd-journal-upload -h ...
--version
Print a short version string and exit.EXIT STATUSOn success, 0 is returned; otherwise, a non-zero failure code is returned.EXAMPLESExample 1. Setting up certificates for authenticationCertificates signed by a trusted authority are used to verify that the server to which messages are uploadedis legitimate, and vice versa, that the client is trusted.A suitable set of certificates can be generated with openssl:openssl req -newkey rsa:2048 -days 3650 -x509 -nodes \
systemd-journal-upload --version ...
-out
cat >ca.conf <<EOF[ ca ]default_ca = this[ this ]new_certs_dir = .certificate = ca.pemdatabase = ./indexprivate_key = ca.keyserial = ./serialdefault_days = 3650default_md = defaultpolicy = policy_anything[ policy_anything ]countryName = optionalstateOrProvinceName = optionallocalityName = optionalorganizationName = optionalorganizationalUnitName = optionalcommonName = suppliedemailAddress = optionalEOFtouch indexecho 0001 >serialSERVER=serverCLIENT=clientopenssl 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.pemopenssl 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.pemGenerated files ca.pem, server.pem, and server.key should be installed on server, and ca.pem, client.pem, andclient.key on the client. The location of those files can be specified using TrustedCertificateFile=,ServerCertificateFile=, ServerKeyFile=, in /etc/systemd/journal-remote.conf and/etc/systemd/journal-upload.conf, respectively. The default locations can be queried by usingsystemd-journal-remote --help and systemd-journal-upload --help.
systemd-journal-upload -out ...