A command-line interface for interacting with logship. The logsh CLI provides powerful tools for managing connections, querying logs, uploading data, and managing subscriptions.
- Check Status:
logshwithout arguments orlogsh whoami - Add Connection:
logsh connection add basic <name> <url> - Query Logs:
logsh query -q "Logship.Agent.Uptime | limit 100"
# Show help and available commands
logsh --help
# Check connection status and current user
logsh
logsh whoami
# Configure connections
logsh connection list
# Query logs
logsh query -q "Logship.Agent.Uptime | limit 100"
# Upload CSV data
logsh upload data.csv
# Manage accounts
logsh account list
logsh account default <name>
# Version information and updates
logsh version
logsh version updateAll query and list commands support multiple output formats:
# JSON
logsh query -q "Logship.Agent.Uptime | limit 100" --output json# Show help
podman run --rm ghcr.io/logship-io/logsh:latest
# Show version
podman run --rm ghcr.io/logship-io/logsh:latest versionThe container is designed to work with your local logsh configuration files.
LOGSH_CONFIG_PATH- Path to the configuration file inside the container (default:/config/logsh-config.json)
# Mount your local ~/.logsh directory to /config in the container
podman run --rm \
-v ~/.logsh:/config:Z \
logsh:latest query -q "SELECT * FROM logs LIMIT 10"# Mount just the config file
podman run --rm \
-v ~/.logsh/logsh-config.json:/config/logsh-config.json:Z \
logsh:latest whoamiCreate a docker-compose.yml:
version: '3.8'
services:
logsh:
image: logsh:latest
volumes:
- ~/.logsh:/config:ro
environment:
- LOGSH_CONFIG_PATH=/config/logsh-config.json
command: ["query", "-q", "SELECT * FROM logs LIMIT 5"]Run with:
docker-compose run --rm logshpodman run --rm -it \
-v ~/.logsh:/config:Z \
logsh:latest query -q "SELECT timestamp, message FROM logs WHERE level='ERROR'"podman run --rm \
-v ~/.logsh:/config:Z \
-v /path/to/logs:/logs:Z \
logsh:latest upload /logs/app.logpodman run --rm \
-v ~/.logsh:/config:Z \
logsh:latest whoami# List accounts
podman run --rm \
-v ~/.logsh:/config:Z \
logsh:latest account ls
# Set default account
podman run --rm \
-v ~/.logsh:/config:Z \
logsh:latest account default 00000000-0000-0000-0000-000000000000Ensure your local configuration file exists and is properly mounted:
# Check if config exists locally
ls -la ~/.logsh/logsh-config.json
# Check if mounted correctly in container
podman run --rm \
-v ~/.logsh:/config:Z \
logsh:latest ls -la /config/If you encounter permission issues, ensure the mounted volume has correct SELinux context (:Z flag) or permissions.
The container may need network access to connect:
# Ensure network access
podman run --rm --network=host \
-v ~/.logsh:/config:Z \
logsh:latest whoami# Build the project
cd logsh && cargo build
# Run with development build
cd logsh && cargo run -- --helpRelease Tags:
latest: Latest stable release version (tagged releases)latest-pre: Latest development build (from main/master branch)