Log Monitoring API - GET export logs
Gets the log records matching the provided criteria. Matching log records are sorted by the criteria specified in the sort query parameter.
Unlike the GET search logs request, this one does not impose a limit on the total number of resulting log records. However, if the resulting log is too large, pagination is applied. You can set the page size in the pageSize query parameter. In such cases, the first response contains the nextPageKey for the second page. Use it in the nextPageKey query parameter to obtain the second page, which in turn contains the nextPageKey for the third page, and so on.
The request produces an application/json
payload.
This request is an Early Adopter release and may be changed in non-compatible way.
GET |
|
Authentication
To execute this request, you need the Read logs (logs.read
) permission assigned to your API token. To learn how to obtain and use it, see Tokens and authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
from | string | The start of the requested timeframe. You can use one of the following formats:
If not set, the relative timeframe of two weeks is used ( | query | optional |
to | string | The end of the requested timeframe. You can use one of the following formats:
If not set, the current timestamp is used. | query | optional |
nextPageKey | string | The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. | query | optional |
pageSize | integer | The number of results per result page. | query | optional |
query | string | The log search query. The query must use the Dynatrace search query language. | query | optional |
sort | string | Defines the ordering of the log records. Each field has a sign prefix (+/-) for sorting order. If no sign prefix is set, then the Currently, ordering is available only for the timestamp (+timestamp for the oldest records first, or -timestamp for the newest records first). When millisecond resolution provided by the timestamp is not enough, log records are sorted based on the order in which they appear in the log source (remote process writing to REST API endpoint or remote process from which logs are collected). | query | optional |
Response
Response codes
Code | Type | Description |
---|---|---|
200 | ExportedLogRecordList | Success |
400 | ErrorEnvelope | Failed. The input is invalid. |
501 | ErrorEnvelope | Failed. The server either does not recognize the request method, or it lacks the ability to fulfill the request. May happen when Grail log storage is enabled. |
Response body objects
The ExportedLogRecordList
object
A list of exported log records.
Element | Type | Description |
---|---|---|
nextPageKey | string | The cursor for the next page of results. Has the value of Use it in the nextPageKey query parameter to obtain subsequent pages of the result. |
pageSize | integer | The number of entries per page. |
results | LogRecord[] | A list of retrieved log records. |
totalCount | integer | The total number of entries in the result. |
The LogRecord
object
A single log record.
Element | Type | Description |
---|---|---|
additionalColumns | object | Additional columns of the log record. |
content | string | The content of the log record. |
eventType | string | Type of event
|
status | string | The log status (based on the log level).
|
timestamp | integer | The timestamp of the log record, in UTC milliseconds. |
Response body JSON model
1{2 "nextPageKey": "___-2lZ43q0AAAAdeJxjYAAC1sLS1KJKBhjggtIijFCGHEwCAFiHAoP___7aVnjerQ",3 "pageSize": 100,4 "results": [5 {6 "additionalColumns": {7 "custom.attribute": [8 "value1",9 "value2"10 ],11 "loglevel": [12 "SEVERE"13 ]14 },15 "content": "example log content",16 "event.type": "LOG",17 "status": "ERROR",18 "timestamp": "1631193089000"19 }20 ],21 "totalCount": 15022}