Navigation

Alpha Release of MongoDB CLI

This is a pre-release early version of MongoDB CLI. Do not use MongoDB CLI to manage production environments.

mongocli ops-manager logs jobs download

On this page

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.

Syntax

mongocli ops-manager|om logs|log jobs|job download <log-collection-job-id>
     [ --out <file-destination> ]
     [ --projectId <id-of-project> ]
     [ --profile|-P <profile-name> ]

Options

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
--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 containing the log collection job you want to download.

Note

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

no

Output

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.

Examples

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

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

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