Skip to main content

CLI harness for Sumo Logic log search API — agent-friendly interface

Project description

cli-anything-sumologic

CLI harness for the Sumo Logic Search Job API. Run Sumo Logic log searches from the command line or from AI agents.

Prerequisites

A Sumo Logic account with API access. No additional software installation required — the CLI calls the Sumo Logic REST API directly over HTTPS.

You will need:

  • Access ID and Access Key from your Sumo Logic account (Preferences → Access Keys)
  • API endpoint for your deployment (e.g. https://api.us2.sumologic.com/api/v1)

Installation

cd agent-harness
pip install -e .

Verify:

which cli-anything-sumologic
cli-anything-sumologic --help

Configuration

Option 1: Environment variables (recommended for agents)

export SUMO_ENDPOINT="https://api.us2.sumologic.com/api/v1"
export SUMO_ACCESS_ID="your-access-id"
export SUMO_ACCESS_KEY="your-access-key"

Option 2: Interactive configure

cli-anything-sumologic auth configure

Credentials are stored in ~/.cli-anything-sumologic/session.json.

Usage

Interactive REPL

cli-anything-sumologic

One-shot commands

# Run a search (last 15 minutes) — TOON output by default
cli-anything-sumologic search run "error | count by _sourceCategory"

# Search with explicit time range
cli-anything-sumologic search run "exception" --from "-1h" --to "now"

# Full indented JSON output (no truncation)
cli-anything-sumologic --format json search run "* | limit 10" --from "-5m"

# Human-readable text
cli-anything-sumologic --format text search run "* | limit 10" --from "-5m"

# Save a query for reuse
cli-anything-sumologic search save my-errors "error | count" --from "-1h"

# Replay a saved query
cli-anything-sumologic search replay my-errors

# Show credential status
cli-anything-sumologic auth status

# Test credentials
cli-anything-sumologic auth test

Command Groups

Group Commands Description
auth configure, status, test Manage credentials
search run, history, saved, save, delete-saved, replay Log searches
job status, messages, records, delete Manage search jobs
session info, clear-history Session state

Output Formats

Flag Description
(no flag) TOON — Token-Oriented Object Notation (default, token-efficient)
--format toon Same as default
--format json Full indented JSON
--format text Human-readable tables (always used inside the REPL)

TOON uses YAML-like key-value pairs for objects and tabular CSV rows for uniform arrays (field names declared once per array). Field truncation is applied before encoding: strings > 500 chars, lists > 20 items, dicts > 30 fields.
--json is a hidden alias for --format json kept for backward compatibility.

Agent Usage (TOON mode — default)

# Credentials check
cli-anything-sumologic auth status

# Run search, parse results — output is compact JSON with truncation
cli-anything-sumologic search run "error | count by _host" --from "-1h"
# {"job_id":"...","is_aggregate":true,"record_count":5,"fields":[...],"records":[{"_host":"web-01","_count":"42"},...]}

# Full JSON when you need untruncated data
cli-anything-sumologic --format json search run "error | count by _host" --from "-1h"

# Dry-run to preview query params
cli-anything-sumologic search run "error" --dry-run --from "-1h"

Running Tests

Unit tests (no credentials needed)

cd agent-harness
pip install -e .
pytest cli_anything/sumologic/tests/test_core.py -v

E2E tests (requires live Sumo Logic credentials)

export SUMO_ENDPOINT="https://api.us2.sumologic.com/api/v1"
export SUMO_ACCESS_ID="your-id"
export SUMO_ACCESS_KEY="your-key"

CLI_ANYTHING_FORCE_INSTALLED=1 pytest cli_anything/sumologic/tests/test_full_e2e.py -v -s

Deployment Endpoints

Region Endpoint
US1 https://api.sumologic.com/api/v1
US2 https://api.us2.sumologic.com/api/v1
EU https://api.eu.sumologic.com/api/v1
AU https://api.au.sumologic.com/api/v1
IN https://api.in.sumologic.com/api/v1
JP https://api.jp.sumologic.com/api/v1
CA https://api.ca.sumologic.com/api/v1
FED https://api.fed.sumologic.com/api/v1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cli_anything_sumologic-1.1.0.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cli_anything_sumologic-1.1.0-py3-none-any.whl (37.0 kB view details)

Uploaded Python 3

File details

Details for the file cli_anything_sumologic-1.1.0.tar.gz.

File metadata

  • Download URL: cli_anything_sumologic-1.1.0.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for cli_anything_sumologic-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4a2e22b7553361df8f0148d26fbc575491bd4858d02317e963d33d5363e8cc38
MD5 2fc0355e2befd894a41e0e3d7ab0df2f
BLAKE2b-256 4dbfdc40243146124345a7d6d7e30d74d18d2b96021ae306ec733d5ab15e2c67

See more details on using hashes here.

File details

Details for the file cli_anything_sumologic-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cli_anything_sumologic-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36a88508c300d60e945b57485beb9bf352380098f1d7e68883f24efbe77234e6
MD5 a84cfaf288666812f7ef270cdd7ab68d
BLAKE2b-256 de30b9958977cee67cfe53feef632cc3dafb3ceccd73e878c734a1076d6cd7f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page