Skip to Content
LakerunnerCLI ReferenceOverview

Lakerunner CLI

The Lakerunner CLI is an intuitive command-line tool to query your S3 logs. It provides fast, flexible access to your observability data without requiring a web interface.

Installation

Grab the Lakerunner CLI from the latest release . Under Assets, choose the appropriate file for your platform:

PlatformAsset
macOS (Apple Silicon)lakerunner-cli_Darwin_arm64.tar.gz
macOS (Intel)lakerunner-cli_Darwin_x86_64.tar.gz
Linux (x86_64)lakerunner-cli_Linux_x86_64.tar.gz
Linux (arm64)lakerunner-cli_Linux_arm64.tar.gz
Windows (x86_64)lakerunner-cli_Windows_x86_64.zip

Unpack the archive, then move the lakerunner-cli binary to a location on your PATH.

macOS / Linux:

tar -xzf lakerunner-cli_Darwin_arm64.tar.gz sudo mv lakerunner-cli /usr/local/bin/ lakerunner-cli --help

Windows (PowerShell):

Expand-Archive .\lakerunner-cli_Windows_x86_64.zip -DestinationPath . # Move the binary somewhere on your PATH (create the folder if needed). Move-Item .\lakerunner-cli.exe "$env:USERPROFILE\bin\lakerunner-cli.exe" lakerunner-cli --help

Add %USERPROFILE%\bin to your PATH via System Properties → Environment Variables (or setx PATH "$env:PATH;$env:USERPROFILE\bin" in a new shell) if it isn’t already.

Configuration

Environment Variables

Set the following environment variables to connect the CLI to your Lakerunner instance.

macOS / Linux:

export LAKERUNNER_QUERY_URL=<your-lakerunner-query-url> export LAKERUNNER_API_KEY=<your-api-key>

Windows (PowerShell):

# For the current session: $env:LAKERUNNER_QUERY_URL = "<your-lakerunner-query-url>" $env:LAKERUNNER_API_KEY = "<your-api-key>" # To persist across sessions (takes effect in new shells): setx LAKERUNNER_QUERY_URL "<your-lakerunner-query-url>" setx LAKERUNNER_API_KEY "<your-api-key>"
VariableDescriptionRequired
LAKERUNNER_QUERY_URLURL of your Lakerunner query endpointYes
LAKERUNNER_API_KEYAPI key for authenticationYes

These can also be passed per-command with --endpoint and --api-key flags.

Config File

The CLI supports an optional config file at ~/.lakerunner/config.yaml for defining presets and aliases.

# ~/.lakerunner/config.yaml presets: prod-errors: - "environment:prod" - "level:ERROR" staging-all: - "environment:staging" aliases: i: environment svc: service pod: k8s_pod_name ns: k8s_namespace_name

Presets are named sets of filters you can apply with -p. Aliases map short names to full attribute names — single-character aliases become short flags (e.g., -i), multi-character aliases become long flags (e.g., --svc).

Global Flags

These flags are available on all commands:

FlagShortDescription
--quiet-qSuppress the “Querying logs…” banner and progress indicator
--no-colorDisable colored output (auto-disabled on Windows and non-TTY stdout)
--endpointAPI endpoint URL (overrides LAKERUNNER_QUERY_URL)
--api-keyAPI key (overrides LAKERUNNER_API_KEY)

Commands

logs get

Retrieve logs with flexible filtering. By default, returns the last hour of logs (newest first), limited to 1000 results.

lakerunner-cli logs get

Flags

FlagShortDescriptionDefault
--limitMaximum number of results1000
--start-sStart time (e.g., e-1h, 2024-01-01T00:00:00Z)1 hour ago
--end-eEnd time (e.g., now, 2024-01-01T23:59:59Z)now
--app-aFilter by application/service name (comma-separated for multiple)
--level-lFilter by log level (ERROR, WARN, INFO, DEBUG, TRACE)
--filter-fFilter as key:value (repeatable)
--preset-pUse a named filter preset from config
--orderSort order for results (newest or oldest)newest
--output-oOutput format (text, json, csv, tsv)text
--contains-MMessage contains string
--not-contains-NMessage does not contain string
--msg-regex-RMessage matches regex
--msg-not-regex-XMessage does not match regex
--columns-cColumns to display (comma-separated)
--queryRaw LogQL query (bypasses other filters)

Time Ranges

The CLI supports flexible time expressions:

  • Relative: e-1h (1 hour before end), e-30m (30 minutes before end), now
  • Absolute: ISO 8601 format like 2024-01-01T00:00:00Z
  • Default: Last hour of data

Column Selection

Use --columns to customize output. Built-in column shortcuts:

ShortcutDescription
timestamp / tsLog timestamp (nanosecond precision when available)
levelLog level (color-coded in text output)
service / svcService name
podKubernetes pod name
messageLog message body

Any log attribute (e.g., trace_id, k8s_namespace_name, container_image_tag) can also be used as a column name. Dotted names like resource.k8s.cluster.name are normalized to underscores automatically.

Examples

# Get the last 500 log entries lakerunner-cli logs get --limit 500
# Get ERROR logs from a specific service lakerunner-cli logs get --level ERROR --app my-service
# Filter by environment and region lakerunner-cli logs get -f "environment:prod" -f "region:us-east-1"
# Search for logs containing a specific string lakerunner-cli logs get --contains "connection timeout"
# Regex match on log messages lakerunner-cli logs get --msg-regex "error|fatal|panic"
# Use a preset lakerunner-cli logs get --preset prod-errors
# Custom time range with specific columns lakerunner-cli logs get --start "e-30m" --columns "timestamp,level,service,message"
# Export logs as JSON lakerunner-cli logs get -o json
# Export daily logs to CSV lakerunner-cli logs get --start "2024-06-01T00:00:00Z" --end "2024-06-02T00:00:00Z" -o csv
# Get oldest logs first lakerunner-cli logs get --order oldest
# Filter multiple services (comma-separated) lakerunner-cli logs get -a "api-server,auth-service"
# Raw LogQL query (see Query Language docs for syntax) lakerunner-cli logs get --query '{service="my-service"} |= "error"'
# Use aliases defined in config lakerunner-cli logs get -i prod --svc my-service

logs get-attr

Discover available log attributes (tag names) for a given time range. Useful for understanding what fields are available to filter on. Without any filters, this runs a fast metadata-only lookup. When any filter flag is provided, the CLI builds a LogQL selector and scopes the returned tag list to attributes present on rows that match — so you only see the attributes actually attached to your logs of interest.

lakerunner-cli logs get-attr

Flags

FlagShortDescription
--start-sStart time
--end-eEnd time
--app-aFilter by application/service name (comma-separated for multiple)
--level-lFilter by log level
--filter-fFilter as key:value (repeatable)
--preset-pUse a named filter preset

Example

# List all available attributes lakerunner-cli logs get-attr # List attributes present on ERROR logs from a specific service lakerunner-cli logs get-attr --level ERROR --app my-service

logs get-values

Get all possible values for a specific attribute. Takes the attribute name as an argument.

lakerunner-cli logs get-values <attribute_name>

Flags

Same as logs get-attr.

Examples

# See all service names lakerunner-cli logs get-values service # See all environments lakerunner-cli logs get-values environment # See log levels in production lakerunner-cli logs get-values level -f "environment:prod"

presets list

List all configured filter presets from your config file.

lakerunner-cli presets list

aliases list

List all configured aliases from your config file.

lakerunner-cli aliases list

Quick Start

  1. Download the CLI from the releases page .

  2. Configure your environment (see Configuration for Windows PowerShell equivalents):

export LAKERUNNER_QUERY_URL=<your-lakerunner-query-url> export LAKERUNNER_API_KEY=<your-api-key>
  1. Query your logs:
lakerunner-cli logs get
  1. Explore available attributes:
lakerunner-cli logs get-attr
  1. Use --help for more options:
lakerunner-cli --help lakerunner-cli logs get --help

Reach out to support@cardinalhq.io for support or to ask questions not answered in our documentation.

Last updated on