Logs Archive Searches
Create an Archive Search
Start a search over the logs stored in an archive.
Without a rehydration object, the search only scans the archive and reports how much data matched. With one, the matched logs are also indexed into a retained historical view, which requires the logs_write_historical_view permission.
post/api/v2/logs/archive_searches
Request
- Base URLhttps://api.datadoghq.com
- Auth
- API key in header DD-API-KEY and API key in header DD-APPLICATION-KEY
- or OAuth 2Authorization code/oauth2/v1/authorizeToken URL/oauth2/v1/token
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"data": {
"attributes": {
"archive_id": "mhmyYmyLTOaFYKvhNadu1w",
"description": "Investigating the checkout latency spike.",
"from": "2026-01-01T00:00:00Z",
"name": "checkout-latency-investigation",
"query": "service:checkout status:error",
"rehydration": {
"max_rehydrated_events": 1000000,
"retention_days": 15,
"tier": "standard"
},
"to": "2026-01-02T00:00:00Z"
},
"type": "archive_search"
}
}Response
OK
Example response
{
"data": {
"attributes": {
"archive_id": "mhmyYmyLTOaFYKvhNadu1w",
"bytes_scanned": 402764439,
"completed_at": "2026-01-02T12:30:00Z",
"created_at": "2026-01-02T12:00:00Z",
"description": "Investigating the checkout latency spike.",
"events_scanned": 1500,
"expected_duration": 120,
"from": "2026-01-01T00:00:00Z",
"name": "checkout-latency-investigation",
"query": "service:checkout status:error",
"rehydration": {
"max_rehydrated_events": 1000000,
"retention_days": 15,
"tier": "standard"
},
"status": "RUNNING",
"to": "2026-01-02T00:00:00Z"
},
"id": "nv2eu4srgyzdkulggjzg2zkmmzifa2rum5iq",
"type": "archive_search"
}
}Changes
Changes to this operation have not been checked yet.