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 |
|
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
Parameter | Type | Description | In | Required |
---|---|---|---|---|
body | Log | 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:
| body | optional |
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.
[
{
"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
Code | Type | Description |
---|---|---|
200 | Success | 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. |
400 | Error | Failed. The input is invalid. |
402 | Error | Failed. You can't add more logs to the storage, because you are out of Davis Data Units (DDU). Purchase additional DDUs. |
404 | Error | Failed. The requested resource doesn't exist. This may happen when no ActiveGate is available with the Log Analytics Collector module enabled. |
429 | Error | Failed. Too Many Requests. This happens when log ingest is disabled. |
501 | Error | 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
Element | Type | Description |
---|---|---|
details | Success | - Can be |
The Success
object
Element | Type | Description |
---|---|---|
message | string | Detailed message Can be |
code | integer | The HTTP status code Can be |
Response body JSON model
{
"details": {
"message": "string",
"code": 1
}
}