scalyr_query_logs
Search Scalyr/DataSet logs with filters and automatic pagination to retrieve matching events, timestamps, messages, and parsed attributes within a specified time range.
Instructions
Search Scalyr/DataSet logs with automatic pagination. Returns matching log events with timestamps, messages, and parsed attributes.
Recommended workflow: use scalyr_facets or scalyr_count first to understand the data volume, then use this tool with a targeted filter and small maxCount.
Filter syntax examples:
$serverHost == "myserver" level == "ERROR"
$serverHost == "bank-cron" (level == "ERROR" || level == "CRITICAL")
$logfile == "/var/log/app.log" status >= 500
Tips:
Use a narrow time range and specific filters to avoid scanning too much data.
The API scans forward from startTime — if most logs are INFO, errors near the end of the range may not be reached with low priority. Use priority "high" or a narrower time window.
Start with maxCount 20-50 to preview results before requesting more.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filter": "<filter>",
"startTime": "<startTime>"
},
"name": "scalyr_query_logs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | Yes | Scalyr filter expression, e.g. '$serverHost == "myserver" level == "ERROR"' | |
| endTime | No | End of time range. Defaults to now | |
| maxCount | No | Maximum log events to return. Start small (20-50) to preview, increase if needed. Default 100, max 5000 | |
| maxPages | No | Maximum pagination requests (default 10). Increase only if you need a large result set | |
| priority | No | Scanning budget. 'low' is cheapest but may miss events in large time ranges. Use 'high' for thorough searches | low |
| startTime | Yes | Start of time range. Relative (e.g. '60m', '24h', '7d') or absolute timestamp |