elasticsearch-esql
Execute ES|QL (Elasticsearch Query Language) queries, use when the user wants to query Elasticsearch data, analyze logs, aggregate metrics, explore data, or…
Skill by Kilo-Org
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/kilo-org-elasticsearch-esql
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
elasticsearch-esql- Description
- Execute ES|QL (Elasticsearch Query Language) queries, use when the user wants to query Elasticsearch data, analyze logs, aggregate metrics, explore data, or create charts and dashboards from ES|QL results.
- License
- Apache-2.0
- Metadata
- category: observability
- Instructions
- 415 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
- Instructions call the network
Files (15)
- LICENSE
- SKILL.md
- local.patch
- package.json
- dsl-to-esql-migration.md · references/
- environment-setup.md · references/
- esql-reference.md · references/
- esql-search-strategy.md · references/
- esql-search.md · references/
- esql-version-history.md · references/
- generation-tips.md · references/
- promql-command.md · references/
- query-patterns.md · references/
- time-series-queries.md · references/
- esql.js · scripts/
SKILL.md (first lines)
# 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](references/esql-version-history.md) for feature
> availability by version.
>
> **Cluster Detection:** Use the `GET /` response to determine the cluster type and version:
>
> - `build_flavor: "serverless"` — Elastic Cloud Serverless. `version.number` tracks the stack line under active
> development (next minor from main), so clients that only semver-compare may treat Serverless as “latest.” **Do not**
> use `version.number` to gate features: if `build_flavor` is `"serverless"`, assume all GA and preview ES|QL features
> are available.
> - `build_flavor: "default"` — Self-managed or Elastic Cloud Hosted. Use `version.number` for feature availability.
> - **Snapshot builds** have `version.number` like `9.4.0-SNAPSHOT`. Strip the `-SNAPSHOT` suffix and use the
> major.minor for version checks. Snapshot builds include all features from that version plus potentially unreleased
> features from development — if a query fails with an unknown function/command, it may simply not have landed yet.
> Elastic employees commonly use snapshot builds for testing.
### Environment Configuration
See [Environment Setup](references/environment-setup.md) for full connection configuration options (Elastic Cloud,
direct URL, basic auth, local development).
Run `node scripts/esql.js test` to verify the connection. If the test fails, refer the user to the environment setup
guide, then stop. Do not try to explore further until a successful connection test.
## Usage
### Get Index Information (for schema discovery)
```bash
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
```bash
node scripts/esql.js raw "FROM logs-* | STATS count = COUNT(*) BY host.name | SORT count DESC | LIMIT 5"
```
### Execute with TSV Output
```bash
node scripts/esql.js raw "FROM logs-* | STATS count = COUNT(*) BY component | SORT count DESC" --tsv
```
**TSV Output Options:**
- `--tsv` or `-t`: Output as tab-separated values (clean, no decorations)
- `--no-header`: Omit the header row
### Test Connection
```bash
node scripts/esql.js test
```
## Guidelines
1. **Detect deployment type**: Always run `node scripts/esql.js test` first. This detects whether the deployment is a
Serverless project (all features available) or a versioned cluster (features depend on version). The `build_flavor`
field from `GET /` is the authoritative signal — if it equals `"serverless"`, ignore the reported version number and
use all ES|QL features freely.
2. **Discover schema** (required — never guess index or field names):
```bash
node scripts/esql.js indices "pattern*"
node scripts/esql.js schema "index-name"
```
Always run schema discovery before generating queries. Index names and field names vary across deployments and cannot
be reliably guessed. Even common-sounding data (e.g., "logs") may live in indices named `logs-test`, `logs-app-*`, or
`application_logs`. Field names may use ECS dotted notation (`source.ip`, `service.name`) or flat custom names — the
only way to know is to check.
**Prefer simplicity:** Query a single index unless the user explicitly asks for data across multiple sources. Do not
combine indices with different schemas using `COALESCE` unless specifically requested — pick the single most relevant
index for the question. When multiple indices contain similar data, prefer the one with the most complete schema for
the task at hand.
The `schema` command reports the index mode. If it shows `Index mode: time_series`, the output includes the data
stream name and copy-pasteable TS syntax — use `TS <data-stream>` (not `FROM`), `TBUCKET(interval)` (not
`DATE_TRUNC`), and wrap counter fields with `SUM(RATE(...))`. Read the full TS section in
[Generation Tips](references/generation-tips.md) before writing any time series query. You can also check the index
mode directly via the Elasticsearch index settings API:
```bash
curl -s "$ELASTICSEARCH_URL/<index-name>/_settings/index.mode" -H "Authorization: ApiKey $ELASTICSEARCH_API_KEY"
```
For TSDS indices on 9.4+, prefer the in-language discovery commands `METRICS_INFO` and `TS_INFO` (both GA) over
inspecting mappings — they enumerate the metric catalogue and the dimension labels of each time series directly. Both
must follow `TS` and must precede `STATS`/`SORT`/`LIMIT`. See
[Time Series Queries](references/time-series-queries.md#metric-and-time-series-discovery).
```bash
node scripts/esql.js raw "TS metrics-tsds | METRICS_INFO | SORT metric_name" --tsv
node scripts/esql.js raw "TS metrics-tsds | TS_INFO | KEEP metric_name, dimensions | SORT metric_name" --tsvFrom Kilo-Org/kilo-marketplace, Apache-2.0.
More from Kilo-Org/kilo-marketplace
- 0.795score
dynamic-tables-tutorial
Snowflake
Interactive tutorial that teaches Snowflake Dynamic Tables hands-on.
SkillAFreshness: A★ 195Claude Code +9 - 0.795score
cortex-code
Snowflake Integration Team
Routes Snowflake-related operations to Cortex Code CLI for specialized Snowflake expertise.
SkillAFreshness: A★ 195Claude Code +9 - 0.795score
dbt-analytics-engineering
dbt-labs
Builds and modifies dbt models, writes SQL transformations using ref() and source(), creates tests, and validates results with dbt show.
SkillAFreshness: A★ 195Claude Code +9 - 0.795score
database-redshift
christopher huffman
Amazon Redshift expert.
SkillAFreshness: A★ 195Claude Code +9 - 0.791score
jupyter-notebook
Kilo
Use whenever the user works with Jupyter notebooks (`.ipynb`), including creating, inspecting, editing, executing, or visualizing notebook content for…
SkillAFreshness: A★ 195Claude Code +9 - 0.791score
gcp-event-driven-architecture-review
github: Raishin
Review GCP Pub/Sub, Eventarc, Cloud Tasks, Cloud Scheduler, and Workflows designs — dead-letter topics, message ordering, idempotency, fan-out blast radius…
SkillAFreshness: A★ 195Claude Code +9 - 0.789score
dbt
dbt-labs
Skills for analytics engineering with dbt - building models, writing tests, querying the semantic layer, troubleshooting jobs, and more.
SkillAFreshness: A★ 195Claude Code +9 - 0.786score
data-investigation
Pedro / Kilo Code
A workflow for conducting rigorous, reproducible data investigations and ad-hoc analyses.
SkillAFreshness: A★ 195Claude Code +9 - 0.786score
apache-arrow
terminal-skills
Expert guidance for Apache Arrow, the cross-language columnar memory format for analytics workloads.
SkillAFreshness: A★ 195Claude Code +9 - 0.786score
dagster
terminal-skills
Dagster is a data pipeline orchestrator built around the concept of software-defined assets.
SkillAFreshness: A★ 195Claude Code +9 - 0.786score
cassandra
terminal-skills
Apache Cassandra is a distributed NoSQL database designed for high availability and linear scalability.
SkillAFreshness: A★ 195Claude Code +9 - 0.786score
prefect
terminal-skills
Prefect is a modern workflow orchestration framework for Python data pipelines.
SkillAFreshness: A★ 195Claude Code +9
Signals
- Stars
- 195
- Forks
- 328
- Open issues
- 18
- Last commit (this folder)
- Jun 24, 2026 (4 months ago)
- Last release
- Sep 28, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/Kilo-Org/kilo-marketplace
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.762score
elasticsearch-esql
elasticOfficial
Execute ES|QL (Elasticsearch Query Language) queries, use when the user wants to query Elasticsearch data, analyze logs, aggregate metrics, explore data, or…
SkillBFreshness: B★ 600Claude Code +9 - 0.397score
elasticsearch-esql
elasticOfficial
Execute ES|QL (Elasticsearch Query Language) queries, use when the user wants to query Elasticsearch data, analyze logs, aggregate metrics, explore data, or…
SkillBFreshness: B★ 600Claude Code +9
More from Kilo-Org
- 0.661score
angular-tooling
Kilo-Org
Use Angular CLI and development tools effectively in Angular v20+ projects.
SkillAFreshness: A★ 195Claude Code +9 - 0.661score
angular-http
Kilo-Org
Implement HTTP data fetching in Angular v20+ using resource(), httpResource(), and HttpClient.
SkillAFreshness: A★ 195Claude Code +9 - 0.661score
elasticsearch-file-ingest
Kilo-Org
Ingest and transform data files (CSV/JSON/Parquet/Arrow IPC) into Elasticsearch with stream processing and custom transforms.
SkillAFreshness: A★ 195Claude Code +9 - 0.661score
senior-data-engineer
Kilo-Org
Data engineering skill for building scalable data pipelines, ETL/ELT systems, and data infrastructure.
SkillAFreshness: A★ 195Claude Code +9 - 0.661score
sql-server-table-reconciliation
Kilo-Org
Use when: comparing SQL Server tables across instances, data migration validation, ETL verification, row mismatch detection, schema drift, reconciliation…
SkillAFreshness: A★ 195Claude Code +9 - 0.661score
dataset-transformation
Kilo-Org
Generates code that transforms datasets between ML schemas for model training or evaluation.
SkillAFreshness: A★ 195Claude Code +9
Cite this page
elasticsearch-esql skill. Agent Mart. https://agentmart.dev/skills/kilo-org-elasticsearch-esql (last updated 2026-10-24)