CorefinityCorefinityDocs
Open the Control PanelControl Panel
Logs · 2 of 20

corestack_logs_query

Query logs.

Scope readNo secrets returned
On this page

When to use it

Search a site's logs with LogsQL over a time window: the matching lines newest first with a cursor for the next page, or one table per log account for a query ending in stats, uniq or top.

Ask for it

Prompt
Using the Corefinity MCP server, call corestack_logs_query with site_id 4211. (Query logs.) Tell me what it returned.

Inputs

cursorstring

next_cursor from the previous page. Up to 65,536 characters.

environment_idinteger

A row of the same site: production or one of its environments. Omitted: the row site_id names. At least 1.

facetsarray of strings

Fields whose top ten values to add (a records page only). Up to 20 items.

filtersobject

The filter builder's entries (level, text, fields), ANDed with the query.

fromstring

ISO 8601; with to, instead of range. Format: date-time.

limitinteger

Defaults to 200. 1 to 1000.

querystring

LogsQL, sent as written (* when empty). Up to 4,096 characters.

rangestring

Back from now, inside the site's retention.

15m1h6h24h7d30d
scopestring

Env (the default): that one row; site: every environment of the site you may see. Defaults to env.

envsite
site_idintegerRequired

The site (any of its environments answers for its group). At least 1.

sourcestring

One log source (corestack_logs_streams_list says which this row has). Defaults to all.

allweb-accessweb-errorphpappcrondatabasecachesearchqueue
tostring

ISO 8601; defaults to now. Format: date-time.

Example call

tools/call
{
  "name": "corestack_logs_query",
  "arguments": {
    "site_id": 4211
  }
}

If it is refused

ReasonWhat to do
invalid_argumentsThe arguments do not match the tool's input schema, or the Control Panel refused a field. Fix the fields named in the answer and call again.
tenant_mismatchThe object does not exist or the token may not see it. Check the id.
scope_requiredThe token lacks a scope this call needs. Open the link in the answer to add it, then call again.
pin_refusedThe grant is limited to chosen clusters, sites or environments, and this call is outside them. Open the link in the answer to widen it.
rate_limitedToo many calls. Wait for the number of seconds the answer names.
temporarily_unavailableThe Control Panel could not answer just now. Nothing was started; try again shortly.
internal_errorSomething went wrong on our side. Quote the trace id to support.

The answer

  • The answer's kind is records (the lines newest first, next_cursor for the next page — send it back with the same limit and window) or table (one table per log account for a query ending in an aggregating pipe; no cursor).
  • Its window {from, to} holds the absolute instants the page was read over, a range resolved back from now. Send these as from / to to read the same window again (later pages, the histogram) instead of a range that moves with the clock.
  • A large page comes as a link. A page larger than an answer carries inline (256 KB by default) answers its metadata — kind, window, next_cursor, effective_query, tenant — with linked {uri, bytes, rows, expires_at, message} and a resource_link to corestack://logs/pages/{ref}. Read that URI with resources/read before it expires (an hour by default): it answers the whole page as this tool's JSON, under the same token. Or call again with a smaller limit. The link works only for the token and person it was issued to.

The same task elsewhere

Was this helpful?
Open in ClaudeOpen in ChatGPT