CLI tool for querying SolarWinds Observability logs
Project description
paperctl
Download logs from SolarWinds Observability. Built with Typer, httpx, and Pydantic.
Installation
Using uv (recommended):
uv tool install paperctl
Or with pip:
pip install paperctl
From source:
git clone https://github.com/jwmossmoz/paperctl.git
cd paperctl
uv pip install -e .
Quick Start
paperctl 2.x talks to the SolarWinds Observability logs API.
Set your API token:
export SWO_API_TOKEN="your_token_here"
For easier upgrades from 1.x, PAPERTRAIL_API_TOKEN is also accepted as a legacy
environment-variable alias. The token itself still needs to be valid for the SWO API.
Pull logs from a single host:
paperctl pull web-1
paperctl pull web-1 --output logs.txt
paperctl pull web-1 --since -24h
Search logs across all hosts or a specific host:
paperctl search "error AND timeout" --since -1h
paperctl search --system web-1 "startup finished" --since -24h
List available hosts via the entities API:
paperctl entities list --type Host
paperctl entities list --name web-1 --output json
What It Does
- Queries SolarWinds Observability logs with automatic pagination
- Pulls logs from one or more hosts, with parallel downloads for multi-host pulls
- Resolves partial hostnames such as Taskcluster VM IDs
- Parses relative times like
-1hand ISO timestamps - Outputs as text, JSON, or CSV
Migration From 1.x
Version 2.x is a breaking change:
- Auth header changed from
X-Papertrail-TokentoAuthorization: Bearer - API base URL changed from
papertrailapp.comto SolarWinds Observability systems/groups/archivescommands were replaced byentitiesPAPERTRAIL_API_TOKENis only a legacy env-var alias now; the token itself must be valid for SWO
Commands
pull
Download logs from one or more hosts.
paperctl pull <system>[,<system>...] [OPTIONS]
Arguments:
<system> System name(s), comma-separated
Options:
-o, --output PATH Output file (single system) or directory (multiple)
--since TEXT Start time (default: all logs)
--until TEXT End time (default: now)
-f, --format TEXT Output format: text|json|csv (default: text)
-q, --query TEXT Search query filter
Examples:
paperctl pull web-1
paperctl pull vm-abc123 --since -24h
paperctl pull web-1,web-2 --output logs/
search
Search logs with optional host filtering.
paperctl search [QUERY] [OPTIONS]
Options:
-s, --system TEXT Filter by system name
--since TEXT Start time
--until TEXT End time
-n, --limit INTEGER Maximum events
-o, --output TEXT Output format
-F, --file PATH Write output to file
tail
Tail logs. This is currently an alias for search --follow.
entities
List and inspect entities such as hosts.
paperctl entities list
paperctl entities list --type Host --output json
paperctl entities show <entity-id>
paperctl entities list-types
config
Manage configuration.
paperctl config show
paperctl config init
Configuration
Configuration is loaded from highest to lowest priority:
- CLI arguments
SWO_API_TOKENPAPERTRAIL_API_TOKENas a legacy alias- Local config:
./paperctl.toml - Home config:
~/.paperctl.toml - XDG config:
~/.config/paperctl/config.toml
Create ~/.paperctl.toml:
api_token = "your_token_here"
api_url = "https://api.na-01.cloud.solarwinds.com"
timeout = 30.0
Time Formats
Relative times:
-1h,-30m,-7d(ago)1h,2d(future)
Natural language:
1 hour ago,2 days ago
ISO 8601:
2024-01-01T00:00:00Z
Special:
now
Rate Limiting
Papertrail's API allows 25 requests per 5 seconds. When pulling from multiple systems, paperctl automatically:
- Runs downloads in parallel
- Tracks requests across all systems
- Throttles to stay under the limit
- Retries with backoff on 429 errors
You don't need to worry about rate limits or pagination. Just specify what you want and paperctl handles the rest.
Development
# Install with dev dependencies
uv pip install -e ".[dev]"
# Run tests
uv run pytest
# Run linters
uv run ruff check .
uv run mypy src
# Format code
uv run ruff format .
# Build package
uv build
# Install pre-commit hooks
uv run prek install
License
Mozilla Public License 2.0 - see LICENSE for details.
Links
- GitHub: https://github.com/jwmossmoz/paperctl
- PyPI: https://pypi.org/project/paperctl/
- SolarWinds Observability: https://documentation.solarwinds.com/en/success_center/observability/default.htm
Author
Jonathan Moss (jmoss@mozilla.com)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paperctl-2.0.1.tar.gz.
File metadata
- Download URL: paperctl-2.0.1.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
313d04e1ee34ad679d542d2475899ceee96b4b83d4b1ab785abb6ff7446ad46c
|
|
| MD5 |
de4aeea55743016c8dce077bcbc770ac
|
|
| BLAKE2b-256 |
6aef8d9e96fa8266379e041300c7188a00c1e31881fd7253af4b53974bf928b4
|
Provenance
The following attestation bundles were made for paperctl-2.0.1.tar.gz:
Publisher:
release.yml on jwmossmoz/paperctl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
paperctl-2.0.1.tar.gz -
Subject digest:
313d04e1ee34ad679d542d2475899ceee96b4b83d4b1ab785abb6ff7446ad46c - Sigstore transparency entry: 1188917129
- Sigstore integration time:
-
Permalink:
jwmossmoz/paperctl@2b0f95770e8667e580fc653e58634b5ebcb5fe55 -
Branch / Tag:
refs/tags/v2.0.1 - Owner: https://github.com/jwmossmoz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2b0f95770e8667e580fc653e58634b5ebcb5fe55 -
Trigger Event:
push
-
Statement type:
File details
Details for the file paperctl-2.0.1-py3-none-any.whl.
File metadata
- Download URL: paperctl-2.0.1-py3-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bc05c384e81f8439752b6035a0730abc97150dbdbd9dc2dd90580a7779a0f9c
|
|
| MD5 |
b864c01da492f128ee7863d639d3120f
|
|
| BLAKE2b-256 |
d5323e129cae6fd15e6543600f443fddc58a46027f04bbefae5ad443298a1164
|
Provenance
The following attestation bundles were made for paperctl-2.0.1-py3-none-any.whl:
Publisher:
release.yml on jwmossmoz/paperctl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
paperctl-2.0.1-py3-none-any.whl -
Subject digest:
1bc05c384e81f8439752b6035a0730abc97150dbdbd9dc2dd90580a7779a0f9c - Sigstore transparency entry: 1188917131
- Sigstore integration time:
-
Permalink:
jwmossmoz/paperctl@2b0f95770e8667e580fc653e58634b5ebcb5fe55 -
Branch / Tag:
refs/tags/v2.0.1 - Owner: https://github.com/jwmossmoz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2b0f95770e8667e580fc653e58634b5ebcb5fe55 -
Trigger Event:
push
-
Statement type: