graylogctl is a production-focused CLI for Graylog v6.3.x (tested for 6.3.4), with first-class support for the Search Scripting API (/api/search/messages).
- Agent-focused operational manual:
docs/AGENT_OPERATIONS.md
- Graylog REST API base path configurable (
--api-base, default/api) - Auth:
- Access token via Basic Auth (
username=<token>,password=token) - Session login via
POST /api/system/sessions(username=<session_id>,password=session)
- Access token via Basic Auth (
- Commands:
auth login|whoami|logoutcluster infosystem overviewnodes listindices statssearch messages relative|absolute|keyword
- Output formats:
tableorjson - Config profiles in
~/.config/graylogctl/config.yaml - Precedence:
flags > env > config > defaults
brew tap davscro/homebrew-tap
brew install davscro/homebrew-tap/graylogctl
graylogctl --helpmake build
./bin/graylogctl --helpPath: ~/.config/graylogctl/config.yaml
profiles:
default:
url: https://graylog.example.com
api_base: /api
insecure: false
auth:
token: ""
session: ""Environment variables:
GRAYLOGCTL_URLGRAYLOGCTL_API_BASEGRAYLOGCTL_TOKENGRAYLOGCTL_SESSIONGRAYLOGCTL_INSECUREGRAYLOGCTL_TIMEOUTGRAYLOGCTL_FORMATGRAYLOGCTL_PROFILE
export GRAYLOGCTL_URL='https://graylog.example.com'
export GRAYLOGCTL_TOKEN='your-graylog-token'
graylogctl system overviewgraylogctl --url https://graylog.example.com auth login --user admin --password 'secret'
graylogctl auth whoamigraylogctl auth logoutgraylogctl search messages relative \
--query 'source:nginx AND error' \
--seconds 300 \
--limit 50 \
--fields 'timestamp,source,message'graylogctl search messages absolute \
--query 'source:nginx AND error' \
--from '2026-02-18T10:00:00Z' \
--to '2026-02-18T11:00:00Z' \
--limit 50 \
--fields 'timestamp,source,message'graylogctl search messages keyword \
--query 'source:nginx AND error' \
--keyword 'last five minutes' \
--limit 50 \
--fields 'timestamp,source,message'--url--api-base--token--session--insecure--timeout(Go duration format, default30s)--format(table|json)--profile--max-width(optional truncation for table cells)
make testIn this environment, tests are run with CGO_ENABLED=0 to avoid local dynamic loader issues.