elasticsearch-esql

elasticsearch-esql is a skill for Claude Code, Codex from aspectrr/deer. It costs 47 tokens per session (1,637 once invoked), scanned A, original, MIT.

A tool for running ES|QL, Elasticsearch’s piped query language, against data stored in Elasticsearch. It can inspect logs and metrics and turn query results into charts or dashboards.

In plain words
What is it for?
Use it to search indices, filter records, aggregate metrics, analyze logs, explore data, and create charts or dashboards from query results.
Why use it?
It avoids writing separate code for common searches, filters, summaries, and sorting of Elasticsearch data. It also clarifies that ES|QL is different from Elasticsearch’s JSON Query DSL, SQL, and EQL.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node scripts/esql.js indices # List all indices.

Good fit Use it to search indices, filter records, aggregate metrics, analyze logs, explore data, and create charts or dashboards from query results.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/aspectrr/deer
agentmods
npx agentmods add skills/aspectrr/deer/elasticsearch-esql

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for elasticsearch-esql

README.md
[![agentmods](https://agentmods.dev/badge/skills/aspectrr/deer/elasticsearch-esql.svg)](https://agentmods.dev/skills/aspectrr/deer/elasticsearch-esql)
Your own site
<a href="https://agentmods.dev/skills/aspectrr/deer/elasticsearch-esql"><img src="https://agentmods.dev/badge/skills/aspectrr/deer/elasticsearch-esql.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,637 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00047 $0.01637
Opus 5 $0.00023 $0.00818
Sonnet 5 $0.00009 $0.00327
Haiku 4.5 $0.00005 $0.00164

Measured 8d ago against content hash 7503f7b6dba8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

elasticsearch-esql scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

deer-cli/internal/skill/defaults/elasticsearch-esql/SKILL.md · 184 lines

How it starts

The opening of the file, as written. The whole thing — 184 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Elasticsearch ES|QL

Execute ES|QL queries against Elasticsearch.

What is ES|QL?

ES|QL (Elasticsearch Query Language) is a piped query language for Elasticsearch. It is NOT the same as:

  • Elasticsearch Query DSL (JSON-based)
  • SQL
  • EQL (Event Query Language)

ES|QL uses pipes (|) to chain commands: FROM index | WHERE condition | STATS aggregation BY field | SORT field | LIMIT n

Prerequisite: ES|QL requires _source to be enabled on queried indices. Indices with _source disabled (e.g., "_source": { "enabled": false }) will cause ES|QL queries to fail.

Version Compatibility: ES|QL was introduced in 8.11 (tech preview) and became GA in 8.14. Features like LOOKUP JOIN (8.18+), MATCH (8.17+), and INLINE STATS (9.2+) were added in later versions. On pre-8.18 clusters, use ENRICH as a fallback for LOOKUP JOIN (see generation tips). INLINE STATS and counter-field RATE() have no fallback before 9.2. Check references/esql-version-history.md for feature availability by version.

Environment Configuration

See Environment Setup for full connection configuration options (Elastic Cloud, direct URL, basic auth, local development).

Usage

Get Index Information (for schema discovery)

node scripts/esql.js indices                    # List all indices
node scripts/esql.js indices "logs-*"           # List matching indices
node scripts/esql.js schema "logs-2024.01.01"   # Get field mappings for an index

Execute Raw ES|QL

node scripts/esql.js raw "FROM logs-* | STATS count = COUNT(*) BY host.name | SORT count DESC | LIMIT 5"

Execute with TSV Output

node scripts/esql.js raw "FROM logs-* | STATS count = COUNT(*) BY component | SORT count DESC" --tsv

Read the full file on GitHub · 184 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 184 lines · 47 tokens per session scan A 7503f7b6dba8

Subscribe to this mod's changes

elasticsearch-esql is a skill published in the GitHub repository aspectrr/deer (404 stars, last pushed 4mo ago), licensed MIT. It adds 47 tokens to every session and 1,637 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

infrahub-sot

OpsMill Infrahub — infrastructure source of truth with schema-driven nodes, GraphQL queries, and branch-isolated changes. Use when querying Infrahub for device/IPAM inventory, browsing infrastructure schemas, running GraphQL queries, or making infrastructure changes safely via an auto-created session branch and a…

automateyournetwork/netclaw · 71 tokens

aws-essentials

Use when standing up the core AWS surface a small product needs: hardening a fresh account, a private S3 bucket, encrypted RDS Postgres, ECS Fargate vs EC2, CloudFront + OAC, or scoping an IAM policy to least privilege. NOT the CI pipeline that ships the container (that is deployment), NOT app-code access-control…

ericrisco/rsc-harness · 89 tokens

elasticsearch-expert

Expert-level Elasticsearch, search, ELK stack, and full-text search. Use when the user mentions search, ELK, Logstash, Kibana, or full text search.

personamanagmentlayer/pcl · 41 tokens

vector-db-ops

Use when vector database operations — Pinecone, Weaviate, Qdrant, ChromaDB. Indexing, querying, filtering, and managing vector embeddings for RAG and similarity search. Use when working with vector db ops.

oyi77/1ai-skills · 52 tokens

Database Optimization

Optimize database queries.

OpenLabor/openlabor · 6 tokens

elasticsearch

Guidance for managing Elasticsearch, a search and data-storage system that organizes information into searchable indexes. It covers cluster health, nodes, shards, indexes, and related status APIs.

chaterm/terminal-skills · 8 tokens