Search a site's logs
Answers the lines of the site that match, newest first; a query that ends in an aggregating pipe, such as | stats count(), answers kind table with table instead of lines. Paged by cursor: send next_cursor back as cursor; null means the last page.
Path parameters
The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.
Body
The site row id of another environment of the same website to read instead of {site}. At least 1.
Filters applied beside the query.
The start of the time range, as a date and time. It must be inside the time your logs are kept for.
A LogsQL query, sent as written. Every line when left out. Up to 4 KB. Up to 4,096 characters.
How far back from now to read. One hour when neither range nor from is sent. Ignored when from is sent.
env reads the one environment. site reads every environment of the website that you can see. Defaults to env.
envsitenullA log source. all reads every source. search and queue exist only on platforms that run them; the sources list says which ones an environment has. Defaults to all.
allweb-accessweb-errorphpappcrondatabasecachesearchqueueThe end of the time range, as a date and time. Now when left out.
The next_cursor of the previous page, sent with the same request. A cursor from another request or another access token is refused 422 on cursor.
Field names whose ten most frequent values to answer beside the lines, as a list or one comma-separated value.
Lines a page. Defaults to 200. 1 to 1000.
Returns
200 A page of lines, or a table.
Fields of the 200 answer
Send as cursor to read the next page. Null on the last page.
The query that was run. * when none was sent.
The fields asked for with facets. Sent only when the request names some and kind is records.
records for log lines, table for the answer of an aggregating query.
recordstableThe lines, newest first. Empty when kind is table.
Fields of each item
The line's other fields, by name. An empty list when it has none.
The line's text.
A log source. all reads every source. search and queue exist only on platforms that run them; the sources list says which ones an environment has. Defaults to all.
allweb-accessweb-errorphpappcrondatabasecachesearchqueueThe stream the line belongs to. With time, it names the line for the context endpoint.
When the line was written. Format: date-time.
Fields
How long the read took.
The groups of an aggregating query. Null when kind is records.
The logs quota the lines count against.
Fields
How much of the quota is used.
How many days lines are kept for.
ok, warning when the quota is nearly used, over_quota, or unavailable.
okwarningover_quotaunavailableTrue when a table was cut at limit rows a group.
The exact time range that was read. Send from and to back to read the same range again.
Fields
Format: date-time.
Format: date-time.
If it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | company_unavailable | Your company is unavailable. |
403 | scope_required | Use a token with the scope named in scope. |
403 | two_factor_required | Turn on two-factor on your account, then send again. |
404 | feature_off | This feature is not on for your organisation yet. |
409 | logs_not_collected | Logs are not being collected for the environment yet. Try again later, or contact support. |
409 | logs_range | The time range is outside the days logs are kept for. Choose a range inside the days the message names. |
409 | logs_unavailable | Logs could not be read, or are not collected for the site yet. Read the message; try again shortly. |
409 | query_too_wide | The search covers too much. Choose a shorter range or a narrower search. |
422 | invalid | Fix the field named in field; errors says why. |
429 | rate_limited | Wait for the seconds in Retry-After. |
503 | logs_busy | Logs are busy at the moment. Try again in a few seconds. |
503 | logs_cluster_unavailable | Logs are not available at the moment. Try again shortly. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/logs/query \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"limit": 200,
"query": "status:>=500",
"range": "1h",
"source": "web-access"
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->post('https://manage.corefinity.com/api/corestack/sites/1042/logs/query', [
'limit' => 200,
'query' => 'status:>=500',
'range' => '1h',
'source' => 'web-access',
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/logs/query', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
limit: 200,
query: 'status:>=500',
range: '1h',
source: 'web-access',
}),
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.post(
"https://manage.corefinity.com/api/corestack/sites/1042/logs/query",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"limit": 200,
"query": "status:>=500",
"range": "1h",
"source": "web-access",
},
)
data = res.json() if res.content else None{
"effective_query": "status:>=500",
"kind": "records",
"lines": [
{
"fields": {
"level": "error",
"method": "GET",
"src": "nginx-access",
"status": 502
},
"msg": "GET /checkout 502",
"source": "web-access",
"stream_id": "00000001000000006754af9632a2745e85c293e5aac08633",
"time": "2026-11-03T09:55:41.215Z"
},
{
"fields": {
"level": "error",
"method": "POST",
"src": "nginx-access",
"status": 500
},
"msg": "POST /basket/add 500",
"source": "web-access",
"stream_id": "00000001000000006754af9632a2745e85c293e5aac08633",
"time": "2026-11-03T09:52:07.004Z"
}
],
"next_cursor": null,
"stats": {
"duration_ms": 84
},
"table": null,
"tenant": {
"percent": 42,
"quota_gb": 20,
"retention_days": 90,
"state": "ok",
"stored_gb": 8.4
},
"truncated": false,
"warnings": [],
"window": {
"from": "2026-11-03T09:00:00.000000000Z",
"to": "2026-11-03T10:00:00.000000000Z"
}
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "logs_not_collected",
"message": "Logs are not being collected for this environment yet",
"reason": "logs_not_collected"
}{
"code": "invalid",
"errors": {
"query": [
"Keep the query under 4 KB."
]
},
"field": "query",
"message": "Keep the query under 4 KB.",
"reason": "invalid"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}{
"code": "logs_busy",
"message": "Logs are busy at the moment. Try again in a few seconds",
"reason": "logs_busy"
}