CorefinityCorefinityDocs
Open the Control PanelControl Panel
Logs · 1 of 25

Get lines around a CoreCluster's log line

Answers one line with the lines before and after it in the same stream, each list oldest first. Name the line as <stream_id>,<time>, both taken from a line a search answered.

GET/api/corestack/clusters/{cluster}/logs/context

Path parameters

clusterintegerRequired

The id of a CoreCluster. Digits only. At least 1.

Query parameters

linestringRequired

The line, as <stream_id>,<time>. Up to 200 characters.

beforeinteger

How many earlier lines to answer. Defaults to 20. 0 to 100.

afterinteger

How many later lines to answer. Defaults to 20. 0 to 100.

sitesarray of integers

The sites of this CoreCluster to read, by site row id: a list (sites[]=1042&sites[]=1051) or one comma-separated value. At most 200. Every site you can see when left out. A site that is not on this CoreCluster, or that you cannot see, answers 404.

environmentstring

production reads each site's production environment. all reads every environment. Defaults to production.

productionall

Returns

200 The line and its neighbours.

Fields of the 200 answer
afterarray of objectsRequired

The later lines, oldest first.

Fields of each item
fieldsobject or arrayRequired

The line's other fields, by name. An empty list when it has none.

msgstringRequired

The line's text.

sourcestringRequired

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-errorphpappcrondatabasecachesearchqueue
stream_idstringRequired

The stream the line belongs to. With time, it names the line for the context endpoint.

timestringRequired

When the line was written. Format: date-time.

siteobject or any or nullRequired

The site the line came from. Null for a query with a pipe, or when the site cannot be told.

beforearray of objectsRequired

The earlier lines, oldest first.

Fields of each item
fieldsobject or arrayRequired

The line's other fields, by name. An empty list when it has none.

msgstringRequired

The line's text.

sourcestringRequired

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-errorphpappcrondatabasecachesearchqueue
stream_idstringRequired

The stream the line belongs to. With time, it names the line for the context endpoint.

timestringRequired

When the line was written. Format: date-time.

siteobject or any or nullRequired

The site the line came from. Null for a query with a pipe, or when the site cannot be told.

lineobjectRequired

One log line of a CoreCluster read, with the site it came from. One log line.

Fields
fieldsobject or arrayRequired

The line's other fields, by name. An empty list when it has none.

msgstringRequired

The line's text.

sourcestringRequired

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-errorphpappcrondatabasecachesearchqueue
stream_idstringRequired

The stream the line belongs to. With time, it names the line for the context endpoint.

timestringRequired

When the line was written. Format: date-time.

siteobject or any or nullRequired

The site the line came from. Null for a query with a pipe, or when the site cannot be told.

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
404line_not_foundThe log line is no longer available. Search again.
409logs_not_collectedLogs are not being collected for the environment yet. Try again later, or contact support.
409logs_scope_splitThese sites keep their logs in different places. Choose a cluster or site.
422invalidFix the field named in field; errors says why.
429rate_limitedWait for the seconds in Retry-After.
503logs_busyLogs are busy at the moment. Try again in a few seconds.
503logs_cluster_unavailableLogs are not available at the moment. Try again shortly.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl 'https://manage.corefinity.com/api/corestack/clusters/1017/logs/context?line=00000001000000003e23e8160039594a33894f6564e1b134%2C2026-11-03T09%3A53%3A00Z' \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
{
  "after": [
    {
      "fields": {
        "level": "info",
        "method": "GET",
        "src": "nginx-access",
        "status": 200
      },
      "msg": "GET /basket/4 200",
      "site": {
        "environment": "Production",
        "id": 1051,
        "label": "journal.harbourandfinch.example.com"
      },
      "source": "web-access",
      "stream_id": "00000001000000003e23e8160039594a33894f6564e1b134",
      "time": "2026-11-03T09:54:00Z"
    }
  ],
  "before": [
    {
      "fields": {
        "level": "info",
        "method": "GET",
        "src": "nginx-access",
        "status": 200
      },
      "msg": "GET /basket/2 200",
      "site": {
        "environment": "Production",
        "id": 1051,
        "label": "journal.harbourandfinch.example.com"
      },
      "source": "web-access",
      "stream_id": "00000001000000003e23e8160039594a33894f6564e1b134",
      "time": "2026-11-03T09:52:00Z"
    }
  ],
  "line": {
    "fields": {
      "level": "info",
      "method": "GET",
      "src": "nginx-access",
      "status": 200
    },
    "msg": "GET /basket/3 200",
    "site": {
      "environment": "Production",
      "id": 1051,
      "label": "journal.harbourandfinch.example.com"
    },
    "source": "web-access",
    "stream_id": "00000001000000003e23e8160039594a33894f6564e1b134",
    "time": "2026-11-03T09:53:00Z"
  }
}
Try it
Held in this tab's memory only. Never stored or sent to us.

Use a token with only the read scope. How to make one

Was this helpful?
Open in ClaudeOpen in ChatGPT