Overview

logsh

The logsh CLI tool is a command-line interface designed to provide a seamless and efficient way to interact with your Logship database. Query logs, upload data, manage connections and accounts — designed for both human users 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

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'