---
title: "Saved queries and downloads"
url: https://docs.corefinity.com/guides/sites/logs-and-monitoring/saved-queries-and-exports
type: guide
last_updated: 2026-11-13
feature: logs
related:
  - https://docs.corefinity.com/api/reference/logs/get-cluster-log-context.md
  - https://docs.corefinity.com/api/reference/logs/start-cluster-logs-export.md
  - https://docs.corefinity.com/api/reference/logs/get-cluster-log-facets.md
  - https://docs.corefinity.com/api/reference/logs/list-cluster-log-fields.md
  - https://docs.corefinity.com/api/reference/logs/list-cluster-log-field-values.md
  - https://docs.corefinity.com/api/reference/logs/get-cluster-log-histogram.md
  - https://docs.corefinity.com/mcp/tools/corestack_logs_streams_list.md
  - https://docs.corefinity.com/mcp/tools/corestack_logs_query.md
  - https://docs.corefinity.com/mcp/tools/corestack_logs_fields_list.md
  - https://docs.corefinity.com/mcp/tools/corestack_logs_field_values_list.md
  - https://docs.corefinity.com/mcp/tools/corestack_logs_context_get.md
  - https://docs.corefinity.com/mcp/tools/corestack_logs_facets_get.md
---
# Saved queries and downloads

Keep a log search to run again, and download the lines a search finds.

## Before you start

- You can open the site in **Managed Websites**. Anyone who can open a site can save a query and download its lines.
- The logs are narrowed to what you want: see [Logs](/guides/sites/logs-and-monitoring/logs).

## Save a query

1. **Save the current search**

   In **Logs**, choose **Saved queries**, then **Save current…**. Enter a **Name** of up to 60 characters and choose **Save**.

   _Screenshot: The Logs toolbar with PHP and 1 h chosen. Under Saved queries, a Name box holds PHP lines, last hour, with Cancel and Save._

2. **Run it again**

   Choose **Saved queries**, then **Run** beside the query.

   _Screenshot: The Saved queries list: Server errors and PHP warnings in the theme under My queries, each with its source, Run and Delete; Sign-in attempts and Failed scheduled tasks under Shared on this site, each with Run; and Save current… at the bottom._

The source, the time range and the filters go back to what you saved.

**My queries** are yours alone: each user keeps up to 50, and **Delete** removes one. **Shared on this site** lists queries Corefinity has shared with everyone who can open the site.

## Download log lines

1. **Open the download**

   Run the search you want, open the **…** menu and choose **Download…**.

   _Screenshot: The Logs toolbar with the ⋯ menu open. Download… is ringed above LogsQL reference._

2. **Prepare the file**

   Choose **CSV** or **JSON (NDJSON)**, then **Prepare download**. The file is prepared even if you close the dialog.

   _Screenshot: The Download logs dialog: the Format choices CSV and JSON (NDJSON), the line Up to 50,000 lines of the current query, and the buttons Close and Prepare download._

3. **Collect the file**

   When the file is ready, choose **Download**. If you closed the dialog, open the **…** menu and choose **Download ready…** first.

   _Screenshot: The Download logs dialog once the file is ready: the format chosen, the line saying the file can be collected for 24 hours, and Download ringed beside Close._

The file holds up to 50,000 lines and stops at 64 MiB: when a search matches more, the newest 50,000 are included. A prepared file can be collected for 24 hours.

## Automate this

**API:** [Create a site's saved log query](https://docs.corefinity.com/api/reference/logs/create-site-log-saved-query.md), scope `write`

```bash
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/logs/saved-queries \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "filters": {
      "level": [
        "warning",
        "error"
      ]
    },
    "name": "PHP warnings",
    "range": "7d",
    "source": "php"
  }'
```

**MCP:** [`corestack_logs_saved_query_create`](https://docs.corefinity.com/mcp/tools/corestack_logs_saved_query_create.md), scope `write`

```json
{
  "name": "corestack_logs_saved_query_create",
  "arguments": {
    "site_id": 4211,
    "name": "Staging",
    "source": "all",
    "range": "15m"
  }
}
```

**Control Panel:** Managed Websites › your site › Logs & monitoring › Logs ([https://manage.corefinity.com/go/logs](https://manage.corefinity.com/go/logs))

## Related

- [Logs](/guides/sites/logs-and-monitoring/logs): Read and narrow a site's logs.&#xA;
- [Activity](/guides/sites/logs-and-monitoring/activity): See what changed on a site, and who.
