When you create an Ops Manager server log collection job, Ops Manager starts background tasks to collect the requested logs from the target servers. Each server collects its logs locally, compresses and encrypts them, and stores the result in the Application Database. Use this endpoint to create a new job.
Base URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v1.0
Resource
POST /admin/omLogCollectionJobs
Required Roles
Requires that the API Key calling this endpoint have the
Global Owner role.
Request Parameters
Request Path Parameters
This endpoint doesn't use HTTP request path parameters.
Request Query Parameters
The following query parameters are optional:
Name | Type | Necessity | Description | Default | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
pretty | boolean | Optional | Flag indicating whether the response body should be in a prettyprint format. |
| ||||||
envelope | boolean | Optional | Flag that indicates whether or not to wrap the response in an envelope. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. For endpoints that return one result, the response body includes:
|
|
Request Body Parameters
Name | Type | Necessity | Description |
|---|---|---|---|
| array of strings | Optional | List of |
| array of strings | Optional | Log types to collect. Each element must be one of the following values:
If you omit this field or pass an empty array, Ops Manager collects every log type. |
| number | Optional | Maximum uncompressed size, in bytes, per log type per server. Must be greater than 0. If you omit this field, Ops Manager auto-allocates the remaining configured storage across the requested servers and log types. |
| string | Optional | Start of the time range to collect, in ISO 8601 UTC format.
If you set this field, you must also set
|
| string | Optional | End of the time range to collect, in ISO 8601 UTC format.
If you set this field, you must also set
|
Note
When you combine a size limit and a time range, Ops Manager applies
the size limit as a safety cap. If the logs in the time range
exceed the size limit, Ops Manager returns the most recent logs up to
the size limit and sets sizeLimitHit to true on the
affected child jobs. If you omit sizeRequestedPerFileBytes
alongside a time range, Ops Manager auto-allocates the remaining
configured storage across the requested servers and log types.
Ops Manager rejects a create request that violates one of these rules:
Rule | Error code | HTTP status |
|---|---|---|
|
| 400 |
|
| 400 |
|
| 400 |
|
| 400 |
The time range must not exceed 7 days. |
| 400 |
The time range must not start earlier than the maximum log history that the Ops Manager administrator has configured. |
| 400 |
Each value in |
| 400 |
The number of concurrent jobs must not exceed 4. |
| 429 |
The estimated storage must not exceed the storage limit that the Ops Manager administrator has configured for log collection. |
| 413 |
Response
Name | Type | Description |
|---|---|---|
| string | Unique identifier of the new Ops Manager server log collection job. |
Example Request
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --include \ --request POST \ "https://<OpsManagerHost>:<Port>/api/public/v1.0/admin/omLogCollectionJobs?pretty=true" \ --data ' { "servers": [ "om-server-1.example.com", "om-server-2.example.com" ], "logTypes": ["APPLICATION", "HTTP_ACCESS"], "sizeRequestedPerFileBytes": 5242880, "logCollectionFromDate": "2026-04-13T10:00:00Z", "logCollectionToDate": "2026-04-14T10:00:00Z" }'
Example Response
Response Header
401 Unauthorized Content-Type: application/json;charset=ISO-8859-1 Date: {dateInUnixFormat} WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=false Content-Length: {requestLengthInBytes} Connection: keep-alive
201 Created Vary: Accept-Encoding Content-Type: application/json Strict-Transport-Security: max-age=300 Date: {dateInUnixFormat} Connection: keep-alive Content-Length: {requestLengthInBytes} X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
Response Body
{ "id": "675a1234567890abcdef1234" }