• Home
  • Dynatrace API
  • Environment
  • Log Monitoring
  • POST ingest logs

Log Monitoring API - POST ingest logs

Pushes custom logs to Dynatrace.

This endpoint requires an ActiveGate with the Log analytics collector module enabled. This module is enabled by default on all of your ActiveGates.

The request consumes one of the following payload types:

  • text/plain—limited to a single log event.
  • application/json—supports multiple log events in a single payload.

Be sure to set the correct Content-Type header and encode payload with UTF-8: application/json; charset=utf-8.

This request is an Early Adopter release and may be changed in non-compatible way.

POST

  • SaaS https://{your-environment-id}.live.dynatrace.com/api/v2/logs/ingest
  • Environment ActiveGate https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/logs/ingest

Authentication

To execute this request, you need the Ingest logs (logs.ingest) permission assigned to your API token. To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
bodyLogMessageJson

The body of the request. Contains one or more log events to be ingested.

The endpoint accepts one of the following payload types, defined by the Accept header:

  • text/plain: supports only one log event.
  • application/json: supports multiple log events in a single payload.
bodyoptional

Request body JSON model

This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.

json
[ { "content": "Exception: Custom error log sent via Generic Log Ingest", "log.source": "/var/log/syslog", "timestamp": "2022-01-17T22:12:31.0000", "severity": "error", "custom.attribute": "attribute value" }, { "content": "Exception: Custom error log sent via Generic Log Ingest", "log.source": "/var/log/syslog", "timestamp": "2022-01-17T22:12:35.0000" }, { "content": "Exception: Custom error log sent via Generic Log Ingest", "log.source": "/var/log/syslog" }, { "content": "Exception: Custom error log sent via Generic Log Ingest" } ]

Response

Response codes

CodeTypeDescription
200SuccessEnvelope

Only a part of input events were ingested due to event size limits or JSON parsing issues.

204-

Success. Response doesn't have a body.

400ErrorEnvelope

Failed. The input is invalid.

402ErrorEnvelope

Failed. You can't add more logs to the storage, because you are out of Davis Data Units (DDU). Purchase additional DDUs.

404ErrorEnvelope

Failed. The requested resource doesn't exist. This may happen when no ActiveGate is available with the Log Analytics Collector module enabled.

429ErrorEnvelope

Failed. Too Many Requests. This happens when log ingest is disabled.

501ErrorEnvelope

Failed. The server either does not recognize the request method, or it lacks the ability to fulfil the request. May happen when indexed log storage is not enabled.

Response body objects

The SuccessEnvelope object

ElementTypeDescription
detailsSuccess-

Can be null.

The Success object

ElementTypeDescription
messagestring

Detailed message

Can be null.

codeinteger

The HTTP status code

Can be null.

Response body JSON model

json
{ "details": { "message": "string", "code": 1 } }
Related topics
  • Log Monitoring

    Learn how to enable Log Monitoring, the insights that Log Monitoring can provide, and more.