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

**Log facets.** The ten most frequent values of each field among the lines a query matches, across the site's log accounts. Scope: read.

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

## When to use it

The ten most frequent values of each field among the lines a query matches, across the site's log accounts.

## Inputs

- `site_id` (integer, ≥ 1, required): The site (any of its environments answers for its group).
- `environment_id` (integer, ≥ 1): A row of the same site: production or one of its environments. Omitted: the row site_id names.
- `scope` (one of `env`, `site`, default `"env"`): env (the default): that one row; site: every environment of the site you may see.
- `source` (one of `all`, `web-access`, `web-error`, `php`, `app`, `cron`, `database`, `cache`, `search`, `queue`, default `"all"`): One log source (corestack_logs_streams_list says which this row has).
- `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 site's retention.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "environment_id": {
      "description": "Production or an environment of the same site; omitted: site_id's row.",
      "minimum": 1,
      "type": "integer"
    },
    "filters": {
      "description": "Filter builder entries (level, text, fields), ANDed.",
      "type": "object"
    },
    "from": {
      "format": "date-time",
      "type": "string"
    },
    "query": {
      "description": "LogsQL (* when empty).",
      "maxLength": 4096,
      "type": "string"
    },
    "range": {
      "description": "Back from now, inside the site's retention.",
      "enum": [
        "15m",
        "1h",
        "6h",
        "24h",
        "7d",
        "30d"
      ],
      "type": "string"
    },
    "scope": {
      "default": "env",
      "description": "site: every environment of the site you may see.",
      "enum": [
        "env",
        "site"
      ],
      "type": "string"
    },
    "site_id": {
      "description": "The site (any of its environments answers for its group).",
      "minimum": 1,
      "type": "integer"
    },
    "source": {
      "default": "all",
      "description": "One log source (see corestack_logs_streams_list).",
      "enum": [
        "all",
        "web-access",
        "web-error",
        "php",
        "app",
        "cron",
        "database",
        "cache",
        "search",
        "queue"
      ],
      "type": "string"
    },
    "to": {
      "format": "date-time",
      "type": "string"
    }
  },
  "required": [
    "site_id"
  ],
  "type": "object"
}
```

## Refusals

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

## Example

```json
{
  "name": "corestack_logs_facets_get",
  "arguments": {
    "site_id": 4211
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_logs_facets_get with site_id 4211. (Log facets.) Tell me what it returned.
```

## The same task elsewhere

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