Skip to main content

Recall Query Language

Recall uses a simple but powerful query language for searching logs.

Basic Syntax

[text search] [field:value]... [| command]
Search for text in log messages:
"payment failed"
Use quotes for phrases, or just type words:
error timeout

Field Filters

Filter by specific fields:
level:error
environment:production
service:api

Available Fields

FieldDescriptionExample
levelLog levellevel:error or level:error,warn
envEnvironmentenv:production
serviceService nameservice:api
commitGit commitcommit:abc123
branchGit branchbranch:main
request_idRequest IDrequest_id:abc-123
sessionSession IDsession:sess_xxx
hostServer hostnamehost:web-1

Time Filters

Filter by time range:
since:1h          # Last hour
since:24h         # Last 24 hours
since:7d          # Last 7 days
since:30m         # Last 30 minutes

until:2024-01-01  # Before a date
Combine them:
since:7d until:1d   # Between 7 days ago and 1 day ago

JSONB Data Queries

Query nested data in the data field:
data.user.id:123
data.order.total:>100
data.payment.status:failed

Operators

data.amount:100       # Equals
data.amount:>100      # Greater than
data.amount:>=100     # Greater than or equal
data.amount:<100      # Less than
data.amount:<=100     # Less than or equal

Negation

Prefix with ! to negate:
level:!debug          # Not debug
env:!test             # Not test
data.user.role:!admin # User is not admin

Combining Filters

All filters are AND’d together:
level:error env:production since:1h
For OR, use comma-separated values:
level:error,warn,fatal

Commands

Pipe to commands for aggregation:

Stats

level:error since:24h | stats
level:error | stats by:hour
level:error | stats by:commit

Sorting

since:1h | sort timestamp:asc
since:1h | sort data.duration_ms:desc

Limiting

level:error | first 10    # Oldest 10
level:error | last 50     # Newest 50 (default)

Examples

Find errors in production

level:error env:production since:1h

Find slow requests

data.duration_ms:>1000 since:24h

Find logs for a specific user

data.user.id:12345 since:7d

Find payment failures

"payment" level:error data.amount:>100

Get error stats by commit

level:error since:24h | stats by:commit

Find all logs for a request

request_id:abc-123-def

Dashboard Shortcuts

The dashboard provides quick filters:
  • Errors - level:error since:1h
  • Fatal - level:fatal since:24h
  • Production - env:production since:1h
  • Last 15m - since:15m
Click any log to filter by its request ID.

API Usage

Use the query language via the API:
curl https://recall.brainzlab.ai/api/v1/logs \
  -H "Authorization: Bearer sk_live_xxx" \
  -G --data-urlencode "query=level:error since:1h"