esql-guide

Teach ES|QL query writing and interpretation for Elasticsearch indices.

6|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/patrykkopycinski/elastic-cursor-plugin --skill esql-guide
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: esql-guide
Source: https://github.com/patrykkopycinski/elastic-cursor-plugin/tree/main/.cursor/skills/esql-guide
Command: npx skills add https://github.com/patrykkopycinski/elastic-cursor-plugin --skill esql-guide

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps users write, understand, and validate ES|QL queries for Elasticsearch so they can extract accurate insights, build reliable dashboards, and avoid common aggregation or display mistakes.

Core Features & Use Cases

  • Clarify analysis goals and index selection: Guides the user to decide whether they need ad-hoc analysis, aggregations, filtering, or data transformation and to identify the relevant index or indices and key fields.
  • Provision and discovery: Recommends using get_mappings or list_indices to discover index and field names before crafting queries.
  • Query composition and execution: Teaches ES|QL syntax elements such as FROM, WHERE, EVAL, STATS, SORT, and LIMIT and recommends running queries with esql_query to validate results.
  • Display-quality patterns for dashboards: Advises using readable column aliases, rounding numeric metrics, renaming dimension columns for clean legends, choosing appropriate bucket intervals for time series, filtering nulls to prevent empty chart points, and handling counter metrics by casting before aggregation.
  • Validation and safety: Suggests LIMIT for large result sets, running queries to show tabular output, and recommending log parsing approaches like DISSECT or GROK when needed.

Quick Start

Show me how to write an ES|QL query that calculates the hourly average temperature from the sensors index over the last 24 hours and formats column aliases for a dashboard.

Frequently Asked Questions about esql-guide

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

FAQPage Schema
How do I write an ES|QL query to aggregate time-series data in Elasticsearch?

To write an ES|QL query for time-series data, use the FROM, EVAL, and STATS commands to bucket timestamps and calculate metrics. You should cast counter metrics before aggregation and filter nulls to prevent empty chart points in your visualizations.

What is the best way to format Elasticsearch query results for Kibana dashboards?

The best way to format Elasticsearch query results for Kibana dashboards is to use readable column aliases and round numeric metrics in your ES|QL query. Renaming dimension columns ensures clean legends, while choosing appropriate bucket intervals optimizes time-series display.

Do I need to check index mappings before running an ES|QL query?

Yes, you need to check index mappings before running an ES|QL query to understand field types and ensure accurate filtering. Discovering index and field names first prevents syntax errors and allows you to correctly cast fields during data transformation.

Can I use ES|QL to filter and transform log data across multiple indices?

Yes, you can use ES|QL to filter and transform log data across multiple indices by specifying them in the FROM clause. You can apply WHERE for filtering, EVAL for transformations, and use DISSECT or GROK for parsing log fields within your queries.

How do I limit the results of an ES|QL query to avoid large data loads?

To limit the results of an ES|QL query and avoid large data loads, append the LIMIT command to the end of your statement. Running the query with esql_query validates the tabular output and ensures the result set remains manageable for ad-hoc analysis.