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.csv

Uploads 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

CommandAliasDescription
contextctxManage contexts (server connections)
configcfgView and manage logsh configuration
accountaccManage Logship accounts
queryExecute a Kusto query against a Logship server
schemaInspect schemas and tables on the connected server
uploadUpload CSV/TSV data files to a Logship schema
versionShow version info and manage self-updates
whoamiShow current user and connection status
completionsGenerate shell completion scripts

Global Flags

FlagDescription
-v / -vvvvIncrease verbosity (error → warn → info → debug → trace)
--no-colorDisable 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)
--quietSuppress non-essential output
-o <format>Output format: table, json, json-pretty, csv, markdown

Environment Variables

VariableDescription
LOGSH_CONFIG_PATHOverride config file path
LOGSH_PAT_TOKENPersonal Access Token for context add --pat
LOGSH_UPDATE_REPOSITORYCustom GitHub repo for self-update (format: owner/repo)
NO_COLORDisable color output (no-color.org)

Exit Codes

CodeMeaning
0Success
1General error
2Authentication failure
3No 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 --help

With Configuration

# Mount config directory
docker run --rm \
  -v ~/.logsh:/config:Z \
  ghcr.io/logship-io/logsh:latest query -q 'MyTable | take 10'