v1
latestOpenAPI 3.0.02026-07-142351,1971.3 MBLogs
Search logs
List endpoint returns logs that match a log search query. Results are paginated.
If you are considering archiving logs for your organization, consider use of the Datadog archive capabilities instead of the log list API. See Datadog Logs Archive documentation.
Note: This endpoint is enabled by default for logs customers. To disable it, contact Datadog support.
post/api/v1/logs-queries/list
Request body
Example request
{
"index": "retention-3,retention-15",
"query": "service:web* AND @http.status_code:[200 TO 299]",
"time": {
"from": "2020-02-02T02:02:02.202Z",
"to": "2020-02-20T02:02:02.202Z"
}
}Response
OK
Example response
{
"logs": [
{
"content": {
"attributes": {
"customAttribute": 123,
"duration": 2345
},
"host": "i-0123",
"message": "Host connected to remote",
"service": "agent",
"tags": [
"team:A"
],
"timestamp": "2020-05-26T13:36:14Z"
},
"id": "AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA"
}
]
}