graylog-cli

Query and analyze Graylog logs from the terminal using Lucene syntax.

1|Updated Apr 22, 2026
One-click install
npx skills add https://github.com/NorceTech/graylog-cli --skill graylog-cli-norcetech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: graylog-cli
Source: https://github.com/NorceTech/graylog-cli/tree/main/skills/graylog-cli
Command: npx skills add https://github.com/NorceTech/graylog-cli --skill graylog-cli-norcetech

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Investigating production issues requires digging through large volumes of logs, and doing this through a web UI is slow and hard to automate. This Skill lets you search, aggregate, and inspect Graylog logs directly from the terminal with structured JSON output suitable for scripting and CI pipelines. ## Core Features & Use Cases - Log Search & Filtering: Run Lucene-based queries with time ranges, field selection, stream scoping, grouping by correlation fields, and automatic pagination up to 10,000 messages. - Aggregations & Health Checks: Compute terms, date histograms, cardinality, and stats aggregations, count messages by log level, list indexed fields, and verify connectivity with ping and system info. - Multi-Instance Profiles: Manage credentials for multiple Graylog instances with named profiles, per-profile field caches, and a global --profile flag. - Use Case: When a checkout outage is reported, run graylog-cli search "level:<=3" with key fields like ExceptionType and correlationId to find the failing service, then trace the full request timeline by grouping events by checkoutCorrelationId. ## Quick Start Ask the AI to authenticate with your Graylog URL and token, then search for all error-level logs from the last hour grouped by source service.

Frequently Asked Questions about graylog-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search Graylog logs from the command line?

Use graylog-cli search with a Lucene query, for example graylog-cli search "level:<=3" --since 1h --field message --field source. Authenticate first with graylog-cli auth --url <URL> --token <TOKEN>, then pipe the JSON output through jq for filtering.

How do I filter Graylog logs by error level?

Graylog stores level as a numeric field from 0 to 7, so use range queries like level:<=3 to match Emergency through Error. Text values like level:ERROR will not match; combine the numeric filter with other conditions using AND.

Can I manage multiple Graylog instances with one CLI?

Yes, graylog-cli supports named profiles stored in a single config.toml file. Switch the active profile with graylog-cli profiles use <name>, or target another instance for one command with the global --profile flag or GRAYLOG_PROFILE environment variable.

Why does my Graylog search return no results when logs exist?

The most common cause is using text level names instead of numeric values, since level is stored as 0-7. Also verify your time range covers the expected period and widen it with --time-range 1d if needed.

What is the maximum number of log messages I can retrieve?

The Graylog API returns at most 500 messages per page, and the --all-pages flag paginates automatically up to a hard limit of 10,000 messages. When truncated, metadata.truncated is set to true, so narrow the query or time range for larger result sets.

Why does my Graylog aggregation fail with HTTP 400?

Aggregations fail on analyzed text fields like message. Use keyword fields such as source, level, ExceptionType, or correlationId instead, and only pass --interval when using the date_histogram aggregation type.