> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gurubase.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Log Analysis

> Upload a log file and get an analysis report, without asking a question

Upload a log or HAR file and get a report back: an overview, a findings table, a timeline, the likely root cause and next checks. The analysis runs in the background. This endpoint answers `202` at once with a `job_id`; poll [Log Analysis Status](https://docs.gurubase.ai/api-reference/endpoints/log-analysis-status.md) for the report.

> [!NOTE]
>
> A log analysis is not a question: it does not appear in analytics and does not count toward the question quota. Its LLM cost is tracked and the Guru's cost limit applies. The uploaded file is cleared when the job ends, and the job and its report are deleted after 7 days.

Requirements and limits:

* Log processing must be enabled for the Guru.
* The file must be an uncompressed text log. UTF-8, UTF-16 (with BOM) and Windows-1254 are accepted; compressed or binary files are refused.
* The file size limit is the Guru's log attachment limit (50 MB by default). A `.har` file uses the HAR limit (50 MB by default, never above 70 MB) and is cleaned before it is stored (header values and cookies removed, secrets masked, static file bodies dropped).
* At most 3 analyses can be queued or running for a Guru at once.

## Path Parameters

**guru\_slug** `string` *required*

The slug of the Guru that analyses the log.

## Headers

**x-api-key** `string` *required*

Your API key for authentication. You can obtain your API key from the [Gurubase dashboard](https://app.gurubase.io/api-keys).

### Body Parameters

Send the request as `multipart/form-data`.

**file** `file` *required*

The log file to analyse (for example `app.log`, `agent.jsonl` or `session.har`).

**question** `string`

What to look for in the log, up to 2000 characters. Without it, the analysis finds the errors, failures and anomalies, when they happened, and what most likely caused them.

### Response

**job\_id** `string`

The job's id (UUID). Use it with [Log Analysis Status](https://docs.gurubase.ai/api-reference/endpoints/log-analysis-status.md).

**status** `string`

`PENDING` right after the upload.

**step** `string`

`queued` right after the upload.

**filename** `string`

The uploaded file's name.

**created\_at** `string`

When the job was created (ISO 8601).

**expires\_at** `string | null`

When the job and its report are deleted (ISO 8601). After this time the status endpoint returns 404.

**status\_url** `string`

The path to poll for the job's status, relative to the API host.

```bash cURL theme={null}
curl --request POST \
  --url https://api.gurubase.io/api/v1/{guru_slug}/log-analysis/ \
  --header 'x-api-key: YOUR_API_KEY' \
  --form 'file=@app.log' \
  --form 'question=Why did the agent stop reporting after the upgrade?'
```

```python Python theme={null}
import requests

url = "https://api.gurubase.io/api/v1/{guru_slug}/log-analysis/"
headers = {"x-api-key": "YOUR_API_KEY"}

with open("app.log", "rb") as f:
    response = requests.post(
        url,
        headers=headers,
        files={"file": ("app.log", f)},
        data={"question": "Why did the agent stop reporting after the upgrade?"},
    )
print(response.status_code, response.json())
```

```json 202 theme={null}
{
    "job_id": "3f1c2b8e-6a4d-4f0e-9b7a-2d5e8c1a9f30",
    "status": "PENDING",
    "step": "queued",
    "filename": "app.log",
    "created_at": "2026-12-04T14:58:49.120000+00:00",
    "expires_at": "2026-12-11T14:58:49.120000+00:00",
    "status_url": "/api/v1/{guru_slug}/log-analysis/3f1c2b8e-6a4d-4f0e-9b7a-2d5e8c1a9f30/"
}
```

```json 400 theme={null}
{
    "msg": "file is required (multipart/form-data)"
}
```

```json 403 theme={null}
{
    "msg": "Log processing is not enabled for this Guru"
}
```

```json 413 theme={null}
{
    "msg": "The file is larger than 50 MB"
}
```

```json 429 theme={null}
{
    "msg": "At most 3 log analyses can run at once for a Guru; wait for one to finish"
}
```

```json 503 theme={null}
{
    "msg": "The analysis could not be queued; try again shortly"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.