SYSTEMD-JOURNAL-UPLOAD(8)

πŸ¦‹ systemd-journal-upload.service + systemd-journal-upload πŸ¦‹

bestie, this is the section 8 manual for the systemd-journal-upload.service system service and the systemd-journal-upload binary. It’s giving β€œsend journal messages over the network” energy, and honestly? iconic. πŸ’…


🌸 NAME 🌸

systemd-journal-upload.service, systemd-journal-upload β€” send journal messages over the network. πŸ’Œ

✨ SYNOPSIS ✨

systemd-journal-upload.service

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

πŸ’– DESCRIPTION πŸ’–

systemd-journal-upload uploads journal entries to the URL you pass with --url=. It reads journal entries from one or more journal files, just like journalctl(1) does. Unless one of the options below limits it, every journal entry the user the program is running as can access gets uploaded, and then the program waits and sends new entries as they become available. ✨

systemd-journal-upload transfers the raw content of the journal file and uses HTTP as the transport protocol. no cap. πŸ“¨

systemd-journal-upload.service is a system service that uses systemd-journal-upload to upload journal entries to a server. It uses the configuration in journal-upload.conf(5). At least the URL= option must be specified. periodt. πŸ‘‘

πŸŽ€ OPTIONS πŸŽ€

  • -u, --url=[https://]URL[:PORT], --url=[http://]URL[:PORT] β€” upload to the address you give it. URL may specify either just the hostname or both the protocol and hostname. https is the default. The port number may be specified after a colon (:), otherwise 19532 will be used by default. ✨ Added in version 239.
  • --system, --user β€” limit uploaded entries to entries from system services and the kernel, or to entries from services of the current user. This has the same meaning as the --system and --user options for journalctl(1). If neither is specified, all accessible entries are uploaded. ✨ Added in version 239.
  • -m, --merge β€” upload entries interleaved from all available journals, including other machines. This has the same meaning as the --merge option for journalctl(1). ✨ Added in version 239.
  • --namespace=NAMESPACE β€” takes a journal namespace identifier string as the argument. Upload entries from the specified journal namespace NAMESPACE instead of the default namespace. This has the same meaning as the --namespace= option for journalctl(1). ✨ Added in version 254.
  • -D, --directory=DIR β€” takes a directory path as the argument. Upload entries from the specified journal directory DIR instead of the default runtime and system journal paths. This has the same meaning as the --directory= option for journalctl(1). ✨ Added in version 239.
  • --file=GLOB β€” takes a file glob as the argument. Upload entries from the specified journal files matching GLOB 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 the --file= option for journalctl(1). ✨ Added in version 239.
  • --cursor= β€” upload entries from the location in the journal specified by the passed cursor. This has the same meaning as the --cursor= option for journalctl(1). ✨ Added in version 239.
  • --after-cursor= β€” upload entries from the location in the journal after the location specified by this cursor. This has the same meaning as the --after-cursor= option for journalctl(1). ✨ Added in version 239.
  • --save-state[=PATH] β€” upload entries from the location in the journal after the location specified by the cursor saved in the file at PATH (/var/lib/systemd/journal-upload/state by default). After an entry is successfully uploaded, update this file with the cursor of that entry. ✨ Added in version 239.
  • --follow[=BOOL] β€” if set to yes, then systemd-journal-upload waits for input. ✨ Added in version 239.
  • --key= β€” takes a path to an SSL key file in PEM format, or -. If - is set, then client certificate authentication checking will be disabled. Defaults to /etc/ssl/private/journal-upload.pem. ✨ Added in version 239.
  • --cert= β€” takes a path to an SSL certificate file in PEM format, or -. If - is set, then client certificate authentication checking will be disabled. Defaults to /etc/ssl/certs/journal-upload.pem. ✨ Added in version 239.
  • --trust= β€” takes a path to an SSL CA certificate file in PEM format, or -/all. If -/all is set, then certificate checking will be disabled. Defaults to /etc/ssl/ca/trusted.pem. ✨ Added in version 239.
  • -h, --help β€” print a short help text and exit.
  • --version β€” print a short version string and exit.

πŸ’€ EXIT STATUS πŸ’€

On success, 0 is returned; otherwise, a non-zero failure code is returned. that’s it, bestie. πŸ’–

🌈 EXAMPLES 🌈

Example 1. Setting up certificates for authentication

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. 🫢

A suitable set of certificates can be generated with openssl. Note, 2048 bits of key length is minimally recommended to use for security reasons: πŸ”

openssl req -newkey rsa:2048 -days 3650 -x509 -nodes \
      -out ca.pem -keyout ca.key -subj '/CN=Certificate authority/'

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:2048 -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:2048 -nodes -out $CLIENT.csr -keyout $CLIENT.key -subj "/CN=$CLIENT/"
openssl ca -batch -config ca.conf -notext -in $CLIENT.csr -out $CLIENT.pem

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 TrustedCertificateFile=, ServerCertificateFile=, and ServerKeyFile= in /etc/systemd/journal-remote.conf and /etc/systemd/journal-upload.conf, respectively. The default locations can be queried by using systemd-journal-remote --help and systemd-journal-upload --help. 🧚

πŸ’œ SEE ALSO πŸ’œ


πŸ’– and that’s the whole page, bestie. this one’s from systemd 261.3 β€” footer vibes, section-8 energy, and no separate date line to worry about. byeee πŸ’…βœ¨

πŸ“¦ where this page comes from