CorefinityCorefinityDocs
Open the Control PanelControl Panel
Logs · 20 of 20

corecluster_logs_export

Export CoreCluster logs.

Scope readRuns as a taskNo secrets returnedCoreCluster
On this page

When to use it

Prepare a CSV or JSON file of the log lines a query matches across a CoreCluster's sites (up to 50,000 lines, each naming its site), to download once in a browser where the person is signed in to the Control Panel. The file is kept for 24 hours.

Ask for it

Prompt
Using the Corefinity MCP server, call corecluster_logs_export with cluster_id 812, format csv, source web-error, range 24h. (Export CoreCluster logs.) Tell me what it returned.

Inputs

cluster_idintegerRequired

The CoreCluster. At least 1.

environmentstring

Production (the default): each site's production row; all: its environments too. Defaults to production.

productionall
filtersobject

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

formatstringRequired

Csv, or json (one JSON object per line).

csvjson
fromstring

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

querystring

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

rangestring

Back from now, inside the cluster's retention.

15m1h6h24h7d30d
sitesarray of integers

The site ids (production rows) of this cluster to read, each once; omitted or empty: every site you may see on it. corestack_site_list with cluster_id names them. Up to 200 items.

sourcestring

One log source. Defaults to all.

allweb-accessweb-errorphpappcrondatabasecachesearchqueue
tostring

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

Example call

tools/call
{
  "name": "corecluster_logs_export",
  "arguments": {
    "cluster_id": 812,
    "format": "csv",
    "source": "web-error",
    "range": "24h"
  }
}

If it is refused

ReasonWhat to do
logs_not_collectedNone of the sites read has its logs collected on this cluster yet (or none is left after sites, environment and the token's pins); nothing to read.
logs_unavailableThis source's logs start once the sites' next platform update has applied.
query_too_wideThe read covers too many sites or too much text at once; name fewer sites, add a source or narrow the window.
logs_cluster_unavailableLogs cannot be read at the moment; try again shortly.
tenant_mismatchAlso answers a platform cluster, and a sites entry that is not one of this cluster's sites you may see.
invalid_argumentsWith fields.query: an aggregating pipe (stats, uniq, top…) — an export is of log lines.
rate_limitedFive exports in ten minutes, shared with corestack_logs_export and the Control Panel.
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.
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.
logs_busySee how this server works.

The answer

Long-running: answers with a task. Poll it (tasks/get, or corestack_task_get) or call corestack_logs_export_get with the download_id it names. When the file is ready the answer holds a Control Panel link the person opens once in a browser where they are signed in; it is never the file itself. A token limited to some sites gets the link only while it still covers every site the export reads (corestack_logs_export_get answers pin_refused otherwise), and a token revoked before the file is built leaves the export failed.

A token limited to some sites

The read holds only the rows the token's pins cover — its lines, and an export's file. A sites entry outside the pins is pin_refused naming that site. Under a token limited to some environments of a site, leave sites out and send environment: "all": the read then covers exactly the rows the token may read.

The same task elsewhere

Was this helpful?
Open in ClaudeOpen in ChatGPT