Navigation

mongocli ops-manager logs jobs download

The logs jobs download command downloads logs collected from a log collection job on the specified Ops Manager project to a .tar.gz file. You can also download logs collected from an Ops Manager project through the Ops Manager API.

You can download logs from both successful and failed log collection jobs. If the job failed, all successful components are downloaded.

mongocli ops-manager|om logs|log jobs|job download <log-collection-job-id>
[ --out <file-destination> ]
[ --output|-o <output-format> ]
[ --projectId <id-of-project> ]
[ --profile|-P <profile-name> ]
Option
Type
Description
Required?
<log-collection-job-id>
string

Unique identifier of the log collection job from which to download logs.

You can retrieve a list of log collection jobs for a project with the mongocli logs jobs list command.

yes
--out, -o
string
Output filename or path to filename. If omitted, logs are downloaded to your current directory as <log-name>.tar.gz.
no
--output, -o
string

Command output format. Valid values are:

  • json for output in JSON format
  • go-template for custom output using the Go template
  • go-template-file for custom output specified using the Go template file

If omitted, the command returns output in the default format.

no
--profile, -P
string
Name of the profile where the public and private keys for the project are saved. If omitted, uses the default profile. To learn more about creating a profile, see Configure the MongoDB CLI.
no
--projectId
string

Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable.

Note

You can retrieve the list of projects, including their IDs, using the mongocli iam project list command.

no

The command downloads the logs of the specified log collection job to:

  • The current directory as a file named <log-name>.tar.gz, or
  • A directory and filename you specify with the --out option.

If the command returns an error, see Troubleshooting for recommended solutions.

The following example uses the mongocli ops-manager logs jobs download command to download the logs from log collection job 5ec1cac4ac1a63007120b4ef. The command uses the default profile where the project ID and the Programmatic API Keys are stored.

mongocli ops-manager logs jobs download 5ec1cac4ac1a63007120b4ef --out myLogs

The previous command downloads the log file myLogs.tar.gz to the current directory.

Give Feedback