---
title: "Tail the default index"
---

> Documentation Index
> Fetch the complete documentation index at: https://sandrinodm.github.io/logbrook/llms.txt
> Use this file to discover all available pages before exploring further.

# Tail the default index

Path: Logbrook API › Default index

`GET /logs/tail`

Streams events as Server-Sent Events, in ingestion order. Without `Last-Event-ID` the stream starts after the newest committed event; with it, retained events after that ID are replayed first.

`log` frames carry one event. A `cursor` frame means the stream has caught up. `gap` and `error` frames end the stream; after a `gap`, search the retained history before you reconnect.

Frame IDs are opaque resume tokens bound to the route and filters. They aren't interchangeable with `next_cursor` values or event `id`s.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Query parameters

- `source` (`tailDefaultLogs.query.source`; string, optional) — Comma-separated read-scoped sources
- `service` (`tailDefaultLogs.query.service`; string, optional) — Exact service
- `logger` (`tailDefaultLogs.query.logger`; string, optional) — Exact logger
- `host` (`tailDefaultLogs.query.host`; string, optional) — Exact host
- `message` (`tailDefaultLogs.query.message`; string, optional) — Literal message substring
- `min_level` (`tailDefaultLogs.query.min_level`; integer, optional) — Minimum numeric severity
- `filter` (`tailDefaultLogs.query.filter`; unknown, optional) — URL-encoded JSON, at most 4096 bytes decoded. Exact, typed matches on top-level attributes; every condition must match, along with the other filters. Missing and null values never match. Duplicate or unknown members and conflicting conditions return `400`. The request path and query together are limited to 32768 bytes.

## Header parameters

- `Last-Event-ID` (`tailDefaultLogs.header.Last-Event-ID`; string, optional) — ID of the last frame you processed, at most 1024 bytes. Send it on the same route with the same filters; anything else returns `400`. An event's JSON `id` is not a resume ID.
  - maxLength 1024; pattern `^v1\.[A-Za-z0-9_-]+$`

## Code samples

### cURL

```bash
curl --request GET \
  --url '<base-url>/logs/tail' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = '<base-url>/logs/tail';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/logs/tail"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

SSE log, cursor, gap, error frames

#### Example

```text
event: cursor
id: v1.eyJ2IjoxLCJraW5kIjoidGFpbCIsInF1ZXJ5IjoiZjMxMWU3YWYzMTU0M2Y1N2VlZjhiYjhjMWM0MTAzZTViMzdmN2E2MzhlZTdmNzY3NmFmOTI5YTg0Y2MxNGUyYSIsImFmdGVyIjoiNCJ9
data: caught up

event: log
id: v1.eyJ2IjoxLCJraW5kIjoidGFpbCIsInF1ZXJ5IjoiZjMxMWU3YWYzMTU0M2Y1N2VlZjhiYjhjMWM0MTAzZTViMzdmN2E2MzhlZTdmNzY3NmFmOTI5YTg0Y2MxNGUyYSIsImFmdGVyIjoiNSJ9
data: {"id":"5","source":"checkout","event_time":1794297663000,"received_at":1794297663383,"level":30,"service":"checkout-api","logger":"payments","host":"web-1","pid":4182,"message":"payment authorized","attributes":{"orderId":"ord_8f3k5"}}

event: cursor
id: v1.eyJ2IjoxLCJraW5kIjoidGFpbCIsInF1ZXJ5IjoiZjMxMWU3YWYzMTU0M2Y1N2VlZjhiYjhjMWM0MTAzZTViMzdmN2E2MzhlZTdmNzY3NmFmOTI5YTg0Y2MxNGUyYSIsImFmdGVyIjoiNSJ9
data: caught up

```

### 400

Invalid resume cursor

### 401

Invalid read credential

### 403

Source outside scope

### 413

A retained event exceeds the subscriber output byte budget before streaming starts

### 429

Subscriber capacity exhausted; Retry-After: 1

### 503

Storage unavailable


Source: https://sandrinodm.github.io/logbrook/api/default-index/tail/index.md
