Overview
See the CLI commands for connections, queries, uploads, and automation.
logsh
The logsh CLI interacts with your Logship database from the command line. Query logs, upload data, and manage connections and accounts — built for both interactive use and CI/automation pipelines.
You can check out the source on GitHub at https://github.com/logship-io/logsh or download the latest release.
Quick Start
# Add a context (connection to a logship server)
logsh ctx add https://my.logship.server
# Check connection status
logsh whoami
# Query logs
logsh query -q 'MyTable | take 10'
# Upload CSV data
logsh upload my_table data.csvUploads negotiate columnar transport with compatible servers. The client parses CSV/TSV locally, uses typed values and string dictionaries, and overlaps parsing, encoding and transfer with bounded reusable buffers. Auto mode samples encoded columns and uses gzip when it saves at least 40% of bytes; low-gain data avoids the compression CPU cost. Older servers receive the original file automatically.
# Require the compact transport; fail before uploading if the server does not support it
logsh upload my_table data.csv --encoding columnar --progress
# Send the original CSV/TSV bytes
logsh upload my_table data.csv --encoding raw--encoding auto is the default. Select raw to send the original CSV/TSV, or columnar to require the binary protocol with gzip (useful when wire savings matter more than compression CPU). A failed upload is never automatically retried using another encoding after data may have been accepted. --progress reports source and wire bytes; JSON output includes encoding (raw, columnar-v1, or columnar-v1+gzip), sourceBytes, and wireBytes.
Commands
| Command | Alias | Description |
|---|---|---|
context | ctx | Manage contexts (server connections) |
config | cfg | View and manage logsh configuration |
account | acc | Manage Logship accounts |
query | Execute a Kusto query against a Logship server | |
schema | Inspect schemas and tables on the connected server | |
upload | Upload CSV/TSV data files to a Logship schema | |
version | Show version info and manage self-updates | |
whoami | Show current user and connection status | |
completions | Generate shell completion scripts |
Global Flags
| Flag | Description |
|---|---|
-v / -vvvv | Increase verbosity (error → warn → info → debug → trace) |
--no-color | Disable colored output |
--context <name> | Use a specific named context instead of the default |
--config-path <path> | Override the config file path |
--account <name> | Override the account for a command (by name) |
--quiet | Suppress non-essential output |
-o <format> | Output format: table, json, json-pretty, csv, markdown |
Environment Variables
| Variable | Description |
|---|---|
LOGSH_CONFIG_PATH | Override config file path |
LOGSH_PAT_TOKEN | Personal Access Token for context add --pat |
LOGSH_UPDATE_REPOSITORY | Custom GitHub repo for self-update (format: owner/repo) |
NO_COLOR | Disable color output (no-color.org) |
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Authentication failure |
| 3 | No connection configured |
Container Usage
Multi-arch Docker images are available: linux/amd64, linux/arm64, linux/arm/v7.
docker run --rm ghcr.io/logship-io/logsh:latest --helpWith Configuration
# Mount config directory
docker run --rm \
-v ~/.logsh:/config:Z \
ghcr.io/logship-io/logsh:latest query -q 'MyTable | take 10'