agentleFS
abdullahkhawerabdullahkhawer/devops-skills/skills/graylog-cli/SKILL.md

graylog-cli

Skill8 starsChanged 6 months agoApache-2.0View on GitHub

Perform Graylog operations using the Graylog HTTP API via curl. Use for searching logs, and inspecting streams, dashboards, and alerts.

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the instance and rules below when constructing all Graylog API commands.

    line 8
  2. Distinctive:

    Update the table below with your Graylog instance URLs and credential file paths:

    line 12
  3. Distinctive:

    If the target instance is unclear, ask the user before running any command.

    line 19
  4. Distinctive:

    NEVER target any Graylog instance not listed in the instance table above.

    line 78
  5. Distinctive:

    NEVER print, display, log, or store the contents of any token file.

    line 79
  6. Very specific:

    Always read the token inline with $(cat <TOKEN_FILE>) — never hardcode a token value in a command.

    line 80
  7. Very specific:

    Always include the X-Requested-By header on every request — Graylog rejects requests without it.

    line 81
  8. Very specific:

    Always pass -s (silent) to curl and pipe through jq for readable output.

    line 82
  9. Distinctive:

    NEVER run DELETE endpoints without explicit user instruction — these are irreversible.

    line 83

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Graylog CLI Skill

Use the instance and rules below when constructing all Graylog API commands.

Instances

Update the table below with your Graylog instance URLs and credential file paths:

EnvironmentBase URLToken File
Productionhttps://<your-graylog-prod-url>~/.graylog/prod.token
Staginghttps://<your-graylog-staging-url>~/.graylog/staging.token

If the target instance is unclear, ask the user before running any command.

Prerequisites (one-time setup by user)

Generate a Graylog API token (System → Users → Edit Tokens) for each instance and save it to the corresponding token file. Never print or display token values. Do not perform these steps yourself.

mkdir -p ~/.graylog && echo "<your-api-token>" > <TOKEN_FILE> && chmod 600 <TOKEN_FILE>

Command Format

Graylog uses the API token as the username with token as the password:

curl -s -u "$(cat <TOKEN_FILE>):token" -H "X-Requested-By: cli" \
  "<BASE_URL>/api/<endpoint>" | jq .

Available API Endpoints

Read-only (safe, no confirmation needed)

EndpointMethodDescription
/api/search/universal/relativeGETRun a relative-time search query
/api/streamsGETList streams
/api/streams/<id>GETGet a specific stream
/api/dashboardsGETList dashboards
/api/alertsGETList triggered alerts
/api/system/indices/index_setsGETList index sets
/api/system/cluster/nodeGETShow cluster node info

Example — search query

curl -s -u "$(cat <TOKEN_FILE>):token" -H "X-Requested-By: cli" \
  "<BASE_URL>/api/search/universal/relative?query=<query>&range=3600&limit=50" | jq .

Mutating operations (confirm with user before running)

EndpointMethodDescription
/api/streamsPOSTCreate a stream
/api/streams/<id>PUTUpdate a stream
/api/dashboardsPOSTCreate a dashboard
/api/streams/<id>/pause / /resumePOSTPause or resume a stream

Never run — requires explicit human approval

EndpointMethodReason
/api/streams/<id>DELETEIrreversible stream deletion
/api/dashboards/<id>DELETEIrreversible dashboard deletion
/api/system/indices/index_sets/<id>DELETEIrreversibly deletes an index set and its data

Rules

  • NEVER target any Graylog instance not listed in the instance table above. If a URL references a different host, stop and ask the user to confirm.
  • NEVER print, display, log, or store the contents of any token file.
  • Always read the token inline with $(cat <TOKEN_FILE>) — never hardcode a token value in a command.
  • Always include the X-Requested-By header on every request — Graylog rejects requests without it.
  • Always pass -s (silent) to curl and pipe through jq for readable output.
  • NEVER run DELETE endpoints without explicit user instruction — these are irreversible.
  • For search queries, always set a bounded range and a reasonable limit — an unbounded search can be slow and return excessive data.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.