Fast, scriptable CLI for querying Sentry issues and events. Designed for developers and AI agents.
- Query and filter Sentry issues using native search syntax
- Inspect event details including stacktraces and breadcrumbs
- Tail new events in real-time (polling-based)
- Human-readable tables or machine-friendly JSON output
- Built-in sensitive data redaction for AI safety
- Field allowlisting for controlled output
- Rate limiting and pagination handled automatically
- Node.js 18+ or Bun runtime
npm install -g @iamjoshing/sloggit clone https://github.com/IamJoshing/slogs.git
cd slogs
npm install
npm linkYour SENTRY_ORG is the organization slug from your Sentry URL:
https://<your-org-slug>.sentry.io/...
^^^^^^^^^^^^^^
This is your SENTRY_ORG
For example, if your Sentry URL is https://acme-corp.sentry.io/issues/, your org slug is acme-corp.
- Go to your Sentry auth tokens page:
https://<your-org-slug>.sentry.io/settings/account/api/auth-tokens/ - Click Create New Token
- Give it a name (e.g., "slog CLI")
- Select the required scopes:
project:readevent:readorg:read
- Click Create Token and copy the token (starts with
sntrys_)
export SENTRY_AUTH_TOKEN="sntrys_your_token_here"
export SENTRY_ORG="your-org-slug"
# Optional: For self-hosted Sentry
export SENTRY_BASE_URL="https://your-sentry.com/api/0"You can add these to your shell profile (~/.bashrc, ~/.zshrc, etc.) or use a .env file.
# List unresolved issues from last 24 hours (default)
slog issues
# List errors from production in the last hour
slog issues --query "is:unresolved level:error" --env production --since 1h
# Get issues as JSON for piping
slog issues --format json --limit 10
# List issues for a specific project
slog issues --project my-project --since 7d# List recent events for an issue
slog events ISSUE-123
# Get full event details with stacktraces
slog events ISSUE-123 --expand
# Output as JSON for processing
slog events ISSUE-123 --format json --expand# Watch for new unresolved errors
slog tail
# Tail production errors with custom poll interval
slog tail --env production --interval 5
# Output new events as JSON (useful for piping to processors)
slog tail --format json --query "level:error"Use --redact to automatically remove sensitive data:
# Redact emails, tokens, API keys, and other secrets
slog events ISSUE-123 --format json --redactRedacted patterns include:
- Email addresses
- Bearer/Basic auth tokens
- JWT tokens
- API keys (various formats)
- AWS credentials
- Sentry auth tokens
- Passwords in URLs
- Sensitive HTTP headers
Use --fields to output only specific fields:
# Only include specific fields in output
slog issues --format json --fields "id,title,level,lastSeen"
# Combine with redaction
slog events ISSUE-123 --format json --redact --fields "eventID,title,dateCreated"slog issues --query "is:unresolved level:error" --env production --since 24hslog events PROJ-1234 --expand --limit 5slog tail --format json | jq '.title'slog issues --format json --redact --limit 50 > issues.jsonslog issues --format json --fields "shortId,title,count,lastSeen" | jq -r '.[] | "\(.shortId): \(.title)"'List issues (error groups) from Sentry.
| Flag | Description | Default |
|---|---|---|
-q, --query <query> |
Sentry search query | - |
-e, --env <env> |
Filter by environment | - |
-s, --since <time> |
Time period (1h, 24h, 7d) | 24h |
-l, --limit <n> |
Max issues to return | 25 |
-p, --project <slug> |
Filter by project | - |
-f, --format <fmt> |
Output format (table/json) | table |
--redact |
Redact sensitive data | false |
--fields <list> |
Comma-separated field list | - |
List recent events for a specific issue.
| Flag | Description | Default |
|---|---|---|
-l, --limit <n> |
Max events to return | 10 |
-x, --expand |
Include stacktrace/breadcrumbs | false |
-f, --format <fmt> |
Output format (table/json) | table |
--redact |
Redact sensitive data | false |
--fields <list> |
Comma-separated field list | - |
Poll for new events and print them as they appear.
| Flag | Description | Default |
|---|---|---|
-q, --query <query> |
Sentry search query | is:unresolved |
-e, --env <env> |
Filter by environment | - |
-p, --project <slug> |
Filter by project | - |
-i, --interval <sec> |
Poll interval in seconds | 10 |
-f, --format <fmt> |
Output format (table/json) | table |
--redact |
Redact sensitive data | false |
--fields <list> |
Comma-separated field list | - |
slog supports Sentry's native search syntax:
# By status
is:unresolved
is:resolved
is:ignored
# By level
level:error
level:warning
level:info
# By assignment
is:assigned
is:unassigned
assigned:me
# By date
lastSeen:-24h
firstSeen:-7d
# By count
times_seen:>100
# Combine queries
"is:unresolved level:error environment:production"slog/
├── bin/
│ └── slog # CLI entrypoint
├── src/
│ ├── api/
│ │ └── client.ts # Sentry API client
│ ├── commands/
│ │ ├── issues.ts # Issues command
│ │ ├── events.ts # Events command
│ │ └── tail.ts # Tail command
│ ├── utils/
│ │ ├── format.ts # Output formatters
│ │ └── redact.ts # Redaction utilities
│ ├── cli.ts # CLI definition
│ ├── config.ts # Configuration loader
│ └── types.ts # TypeScript types
├── package.json
└── tsconfig.json
MIT