# logs-query

> Claude/Codex skill by [@betterstackhq](https://omgskills.com/library/betterstackhq/index.md) · 4 stars · Updated 2026-10-23

MUST load BEFORE writing any Better Stack logs or web-events SQL query. Contains required syntax for raw-event queries - without this, queries will fail. Compatible with Explore. Also load when the user asks how raw-event queries look.

## Install

```sh
git clone https://github.com/BetterStackHQ/claude-plugin /tmp/claude-plugin && ln -s /tmp/claude-plugin/skills/logs-query ~/.claude/skills/logs-query
```

## From README

Logs Query Building Guide Where the query runs These queries read raw events, so they run ad hoc through query and renderchart; dashboard charts only read the metrics collection (see dashboard-builder for log and span volumes there). query and renderchart take no template variables. First call queryhelp with the source ID: it names the source's collections and the table to pass. Put the collection where {{source}} stands (e.g. remote(t123myapplogs) for the last 30 minutes, s3Cluster(primary, t123myapps3) with its row-type filter for older rows), a bucket such as toStartOfInterval(dt, INTERVAL 5 MINUTE) where {{time}} stands, and concrete bounds such as dt \> now() - INTERVAL 3 HOUR for {{starttime}} and {{endtime}}. Add a LIMIT, and call querywindows before an s3Cluster(...) query over more than a few hours.

## Links

- HTML page: https://omgskills.com/library/betterstackhq/claude-plugin/skills/logs-query/
- GitHub: https://github.com/BetterStackHQ/claude-plugin
- Author: [@betterstackhq](https://omgskills.com/library/betterstackhq/index.md)

## More from this repo

- [chart-alerts](https://omgskills.com/library/betterstackhq/claude-plugin/skills/chart-alerts/index.md) — Guide for creating and managing Better Stack chart alerts.
   - [@betterstackhq](https://omgskills.com/library/betterstackhq/index.md) · 4 stars
- [chart-generation](https://omgskills.com/library/betterstackhq/claude-plugin/skills/chart-generation/index.md) — Complete reference for chart types, units, and settings on Better Stack dashboards.
   - [@betterstackhq](https://omgskills.com/library/betterstackhq/index.md) · 4 stars
- [chart-styling](https://omgskills.com/library/betterstackhq/claude-plugin/skills/chart-styling/index.md) — Better Stack chart styling and advanced settings reference - series colors and order, number chart coloring thresholds,...
   - [@betterstackhq](https://omgskills.com/library/betterstackhq/index.md) · 4 stars
