---
title: "corecluster_logs_histogram_get"
url: https://docs.corefinity.com/mcp/tools/corecluster_logs_histogram_get
type: tool
last_updated: 2026-11-13
feature: logs
related:
  - https://docs.corefinity.com/api/reference/logs/get-cluster-log-histogram.md
  - https://docs.corefinity.com/guides/sites/logs-and-monitoring/logs.md
---
# corecluster_logs_histogram_get

**CoreCluster log histogram.** Lines a query matches over time across a CoreCluster's sites, in 10 to 200 buckets split by log level. Scope: read.

- Scope: `read`
- Runs as a task: no

## When to use it

How many lines a query matches over time across a CoreCluster's sites, in 10 to 200 buckets (60 by default), each split by log level. Start here to see when errors rose, then read the lines with `corecluster_logs_query`.

## Inputs

- `cluster_id` (integer, ≥ 1, required): The CoreCluster.
- `sites` (array of integer, up to 200 items): 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.
- `environment` (one of `production`, `all`, default `"production"`): production (the default): each site's production row; all: its environments too.
- `source` (one of `all`, `web-access`, `web-error`, `php`, `app`, `cron`, `database`, `cache`, `search`, `queue`, default `"all"`): One log source.
- `query` (string, up to 4096 characters): LogsQL, sent as written (* when empty).
- `filters` (object): The filter builder's entries (level, text, fields), ANDed with the query.
- `from` (string): ISO 8601; with to, instead of range.
- `to` (string): ISO 8601; defaults to now.
- `range` (one of `15m`, `1h`, `6h`, `24h`, `7d`, `30d`): Back from now, inside the cluster's retention.
- `buckets` (integer, 10–200, default `60`)

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "buckets": {
      "default": 60,
      "maximum": 200,
      "minimum": 10,
      "type": "integer"
    },
    "cluster_id": {
      "minimum": 1,
      "type": "integer"
    },
    "environment": {
      "default": "production",
      "enum": [
        "production",
        "all"
      ],
      "type": "string"
    },
    "filters": {
      "type": "object"
    },
    "from": {
      "format": "date-time",
      "type": "string"
    },
    "query": {
      "maxLength": 4096,
      "type": "string"
    },
    "range": {
      "enum": [
        "15m",
        "1h",
        "6h",
        "24h",
        "7d",
        "30d"
      ],
      "type": "string"
    },
    "sites": {
      "description": "Site ids; omitted: all.",
      "items": {
        "type": "integer"
      },
      "maxItems": 200,
      "type": "array"
    },
    "source": {
      "default": "all",
      "enum": [
        "all",
        "web-access",
        "web-error",
        "php",
        "app",
        "cron",
        "database",
        "cache",
        "search",
        "queue"
      ],
      "type": "string"
    },
    "to": {
      "format": "date-time",
      "type": "string"
    }
  },
  "required": [
    "cluster_id"
  ],
  "type": "object"
}
```

## Refusals

- `logs_not_collected`: none 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_unavailable`: this source's logs start once the sites' next platform update has applied.
- `query_too_wide`: the read covers too many sites or too much text at once; name fewer `sites`, add a source or narrow the window.
- `logs_cluster_unavailable`: logs cannot be read at the moment; try again shortly.
- `tenant_mismatch` also answers a platform cluster, and a `sites` entry that is not one of this cluster's sites you may see.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

While the logs servers are busy a read answers `logs_busy`; try again in a few seconds.

## Example

```json
{
  "name": "corecluster_logs_histogram_get",
  "arguments": {
    "cluster_id": 812,
    "source": "web-access",
    "range": "24h",
    "buckets": 48
  }
}
```

## The answer

`{buckets[] {from, count, levels}, warnings}`. A query VictoriaLogs cannot bucket answers no buckets and the warning "No histogram for this query".

## 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.

## Prompt

```text
Using the Corefinity MCP server, call corecluster_logs_histogram_get with cluster_id 812, source web-access, range 24h, buckets 48. (CoreCluster log histogram.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [GET /api/corestack/clusters/{cluster}/logs/histogram](https://docs.corefinity.com/api/reference/logs/get-cluster-log-histogram.md)
- Guide: [Logs](https://docs.corefinity.com/guides/sites/logs-and-monitoring/logs.md)
