Install

Install

logsh releases are hosted on GitHub. It's a contained executable and can run from any location.

To install, download the latest executable for your platform and add it to your environment PATH.

Supported Platforms

PlatformArchitecture
Linuxx86_64, aarch64, armv7 (RPi), arm, musl (static)
macOSx86_64 (Intel), aarch64 (Apple Silicon)
Windowsx86_64, aarch64
FreeBSDx86_64

Docker

docker run --rm ghcr.io/logship-io/logsh:latest --help

Multi-arch images available: linux/amd64, linux/arm64, linux/arm/v7

TagDescription
latestLatest stable release
latest-preLatest development build

Help

Adding --help as a flag will output documentation.

logsh --help

Version

To view version information:

logsh version

Self-Update

logsh version --update            # Update to latest stable release
logsh version --update-prerelease # Update to latest dev build
logsh version --update --yes      # Skip confirmation prompt
logsh version --update --repo owner/repo  # Use a custom update repository

Set Up a Connection

logsh uses contexts to manage server connections.

Basic Auth

logsh ctx add https://my.logship.server

You will be prompted for your username and password securely. To provide the username upfront:

logsh ctx add https://my.logship.server --name prod --username admin

For non-interactive environments, the password can be piped via --password-stdin:

echo "$PASSWORD" | logsh ctx add https://my.logship.server --username admin --password-stdin

Personal Access Token (CI/Automation)

logsh ctx add https://my.logship.server --pat --token $LOGSH_PAT_TOKEN

Or read the token from stdin:

echo "$TOKEN" | logsh ctx add https://my.logship.server --pat --token-stdin

OAuth (SSO)

logsh ctx add https://my.logship.server --sso

Verify Connectivity

logsh whoami

Manage Contexts

logsh ctx ls                    # List all contexts
logsh ctx use prod              # Switch to a context
logsh ctx use prod --account myaccount  # Switch context and account
logsh ctx current               # Show the current context
logsh ctx login                 # Re-authenticate the current context
logsh ctx rm old-ctx            # Remove a context

Queries

# Inline query
logsh query -q 'MyTable | take 10'
# Read query from a file
logsh query -f query.kql
# Read query from stdin
echo 'MyTable | count' | logsh query
# Output formats: table (default), json, json-pretty, csv, markdown
logsh query -q 'MyTable | take 5' -o json
logsh query -q 'MyTable | take 5' -o csv > output.csv
# Custom timeout
logsh query -q 'BigTable | summarize count() by bin(timestamp, 1h)' -t 5m

Schema Inspection

logsh schema ls                   # List all tables
logsh schema describe MyTable     # Show columns and types for a table

Data Upload

logsh upload my_table data.csv             # Upload a CSV file
logsh upload my_table data.tsv --progress  # Upload a TSV file with progress

Account Management

logsh acc ls                     # List accounts
logsh acc ls --include-all      # Include all accounts
logsh acc use myaccount         # Switch to an account
logsh acc current               # Show current account
logsh acc delete <id>           # Delete an account

Shell Completions

# Bash
logsh completions bash > ~/.local/share/bash-completion/completions/logsh
# Zsh
logsh completions zsh > ~/.zfunc/_logsh
# Fish
logsh completions fish > ~/.config/fish/completions/logsh.fish
# PowerShell
logsh completions powershell >> $PROFILE

Example: Run a Smoke Query

logsh ctx add http://localhost:5000 --name local
logsh query -q 'schema.tables | take 5'