Lakerunner
CLI Reference

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

Download the Lakerunner CLI binary from the latest release (opens in a new tab). 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
Windows (x86_64)lakerunner-cli_Windows_x86_64.zip

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

Configuration

Environment Variables

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

export LAKERUNNER_QUERY_URL=<your-lakerunner-query-url>
export 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"
    - "log_level:ERROR"
  staging-all:
    - "environment:staging"
 
aliases:
  i: resource_installation
  svc: resource_service_name
  env: environment
  pod: resource_k8s_pod_name
  ns: resource_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
--verbose-vEnable verbose output
--quiet-qSuppress informational output
--no-colorDisable colored output
--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:

ShortcutFull Name
tstimestamp
svcservice

Any log attribute can also be used as a column name.

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 '{resource_service_name="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.

lakerunner-cli logs get-attr

Flags

FlagShortDescription
--start-sStart time
--end-eEnd time
--app-aFilter by application/service name
--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 for ERROR logs only
lakerunner-cli logs get-attr --level ERROR

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 resource_service_name
 
# See all environments
lakerunner-cli logs get-values environment
 
# See log levels in production
lakerunner-cli logs get-values log_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 (opens in a new tab).

  2. Configure your environment:

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.