Get a list of logs

GET {{baseUrl}}/api/v2/logs/events

List endpoint returns logs that match a log search query. Results are paginated.

Use this endpoint to see your latest logs.

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.

Request Params

KeyDatatypeRequiredDescription
filter[query]stringSearch query following logs syntax.
filter[indexes]stringFor customers with multiple indexes, the indexes to search.
Defaults to '*' which means all indexes
filter[from]stringMinimum timestamp for requested logs.
filter[to]stringMaximum timestamp for requested logs.
filter[storage_tier]stringSpecifies the storage type to be used
sortstringOrder of logs in results.
page[cursor]stringList following results with a cursor provided in the previous query.
page[limit]numberMaximum number of logs in the response.

HEADERS

KeyDatatypeRequiredDescription
Acceptstring

RESPONSES

status: OK

{"data":[{"attributes":{"attributes":{"customAttribute":123,"duration":2345},"host":"i-0123","message":"Host connected to remote","service":"agent","status":"INFO","tags":["team:A"],"timestamp":"2019-01-02T09:42:36.320Z"},"id":"AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA","type":"log"},{"attributes":{"attributes":{"customAttribute":123,"duration":2345},"host":"i-0123","message":"Host connected to remote","service":"agent","status":"INFO","tags":["team:A"],"timestamp":"2019-01-02T09:42:36.320Z"},"id":"AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA","type":"log"}],"links":{"next":"https://app.datadoghq.com/api/v2/logs/event?filter[query]=foo\u0026page[cursor]=eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ=="},"meta":{"elapsed":132,"page":{"after":"eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ=="},"request_id":"MWlFUjVaWGZTTTZPYzM0VXp1OXU2d3xLSVpEMjZKQ0VKUTI0dEYtM3RSOFVR","status":"done","warnings":[{"code":"unknown_index","detail":"indexes: foo, bar","title":"One or several indexes are missing or invalid, results hold data from the other indexes"},{"code":"unknown_index","detail":"indexes: foo, bar","title":"One or several indexes are missing or invalid, results hold data from the other indexes"}]}}