13. Automatic Upload of Resulting sos Report Archive-file Written on . Posted in sos command.

sos report Direct Upload
The sos command's integration with protocols like HTTPS, SFTP, and FTP simplifies direct upload, reducing the manual steps involved in diagnostics.
It is possible to upload the resulting sos report archive-file directly from the command line to a sos report diagnostic and analysis service or to the server from your technical support team. The file can be transferred using either SFTP or an HTTPS upload request.
In any case a valid URL, a valid username and a valid password are required and have to be provided in the command line of the sos report execution as follows:
--upload-url URL
A support protocol must be specified in this URL. Currently, uploading is supported for HTTPS, SFTP, and FTP protocols. If your destination server listens on a non-standard port, specify the listening port in the URL. A common URL will look like these:
https://sos-vault.com/api/upload
sftp://support.redhat.com:2022/customers
If no username and/or not a password is provided, You will be prompted for a username and password (except if the --batch option was used). If these credentials are not provided, sos will still run and create an archive but will not attempt an automatic upload, instead relying on the end user to upload it as needed.
--upload-user USER
Specify the username to use for authentication with the destination server usually your email address in the case of sos-vault.
--upload-pass PASS
Specify the password to use for authentication with the destination server.
--upload-directory DIR
Specify a directory to upload to. Default is '/'.
--upload-method METHOD
Specify the HTTP method to use for uploading to the provided --upload-url. Valid values are 'auto' (default), 'put', or 'post'.
--upload-no-ssl-verify
Disable SSL verification for HTTPS uploads. This may be used to allow uploading to locations that have self-signed certificates, or certificates that are otherwise untrusted by the local system. Use this option with caution. Disabling SSL verification can expose you to man-in-the-middle (MITM) attacks.
sos report Example
The command line to generate an obfuscated and encrypted sos report from your system and automatically upload it to a sos-vault vault will look something like this:
sudo sos report -q --clean --batch --case-id "CASE_ID" --encrypt-pass "***ENCRYPTION PASSWORD***" --upload-url "https://sos-vault.com/api/upload" --upload-user "USER@example.com" --upload-pass "***UPLOAD PASSWORD***" --upload-method post
Please note that you have to use your own CASE_ID, USER (email address), ENCRYPTION PASSWORD and UPLOAD PASSWORD in the above example for the command to work properly.
sos Upload
Starting from v8.9.0, the sos command supports the upload subcommand to upload sos reports to a policy defined remote location (Red-Hat or Ubuntu policies), or a user defined location. This subcommand is used to upload previously generated sos reports.
Once the resulting sos report archive-file has been created (after the first sos report execution), upload it using the sos upload command. Is similar to the behaviour described previuosly but a second sos command execution is required.
sos upload supports exactly the same options decribed above. The command would look like this:
sudo sos upload /tmp/sosreport-ganimide-aver-SSUP2026-2024-12-28-zzvynpw.tar.xz.gpg --case-id "CASE_ID" --encrypt-pass "***ENCRYPTION PASSWORD***" --upload-url "https://sos-vault.com/api/upload" --upload-user "USER@example.com" --upload-pass "***UPLOAD PASSWORD***" --upload-method post
Upload with curl
Another option is to upload after the resulting sos report archive-file has been created (after sos report execution) by means of curl or wget. For example, assume that the execution of the sos report command created the file sosreport-ganimide-aver-SSUP2026-2024-12-28-zzvynpw.tar.xz under the /tmp directory, then the following curl command will upload the archive-file to the diagnostic and analysis service.
(NOTE: You need to change the macros USERNAME, PASSWORD in the following example, with your own data accordingly).
sudo curl -X POST -u USERNAME:PASSWORD -F "file=@/tmp/sosreport-ganimide-aver-SSUP2026-2024-12-28-zzvynpw.tar.xz.gpg" https://sos-vault.com/api/upload