elasticsearch-esql

Execute ES|QL queries against Elasticsearch deployments for data analysis.

546|44|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/elastic/agent-skills --skill elasticsearch-esql-elastic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: elasticsearch-esql
Source: https://github.com/elastic/agent-skills/tree/main/skills/elasticsearch/elasticsearch-esql
Command: npx skills add https://github.com/elastic/agent-skills --skill elasticsearch-esql-elastic

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @elastic/elasticsearch, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill allows users to query and analyze data directly within Elasticsearch using the powerful ES|QL (Elasticsearch Query Language), enabling complex data exploration, log analysis, and metric aggregation without leaving their AI agent.

Core Features & Use Cases

  • Execute ES|QL Queries: Run any valid ES|QL query against your Elasticsearch cluster.
  • Data Exploration & Analysis: Analyze logs, aggregate metrics, explore data, and create charts from ES|QL results.
  • Schema Discovery: Easily retrieve index mappings and list available indices to inform your queries.
  • Use Case: Analyze web server logs to find the top 10 most frequent IP addresses making requests in the last 24 hours, or identify error trends across different services.

Quick Start

Use the elasticsearch-esql skill to find the top 5 hosts by error count in the last hour.

Frequently Asked Questions about elasticsearch-esql

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

FAQPage Schema
How do I query Elasticsearch logs using ES|QL from an AI agent?

You can query Elasticsearch logs using ES|QL by executing queries directly against your cluster, enabling complex data exploration and log analysis without leaving your AI agent environment.

Can I aggregate metrics and generate charts from Elasticsearch query results?

Yes, you can aggregate metrics and generate charts from Elasticsearch query results by running ES|QL queries that process and visualize data directly from your deployment.

What do I need to connect to an Elasticsearch cluster for data exploration?

To connect to an Elasticsearch cluster for data exploration, you need to set environment variables for cluster connection details, including your Cloud ID, URL, API Key, or Basic Auth credentials.

How do I find available indices and schema mappings before writing an ES|QL query?

You can find available indices and schema mappings before writing an ES|QL query by using built-in schema discovery utilities to retrieve index mappings and list available indices.

What is the best way to analyze web server logs for frequent IP addresses in Elasticsearch?

The best way to analyze web server logs in Elasticsearch is using ES|QL queries to filter time ranges and aggregate frequent IP addresses making requests, such as finding the top 10 in the last 24 hours.