elasticsearch-esql
Skill19 starsChanged 8 months agoMITView on GitHub
Use this skill when writing or debugging ES|QL queries for Elasticsearch. Activate when the user asks to query logs, metrics, traces, or any Elasticsearch data using ES|QL syntax.
We split this skill into the rules it gives an agent
8 rules. 0 are common, 1 is distinctive, and 7 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Use the elastic CLI:
- Very specific: line 93
Always specify a time range with WHERE @timestamp > NOW() - <duration> to avoid scanning too much data
- Very specific: line 94
Use LIMIT to control output size
- Very specific: line 95
Use KEEP to select specific columns before output
- Very specific: line 96
Use DROP to exclude columns
- Very specific: line 97
Use RENAME old AS new to rename columns
- Very specific: line 98
Use EVAL new_field = expression to create computed columns
- Very specific: line 99
Use DISSECT or GROK for parsing unstructured text fields
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Elasticsearch ES|QL Query Authoring
ES|QL Basics
ES|QL (Elasticsearch Query Language) is a piped query language for filtering, transforming, and aggregating Elasticsearch data.
Syntax
FROM <index-pattern>
| WHERE <condition>
| STATS <aggregation> BY <field>
| SORT <field> [ASC|DESC]
| LIMIT <n>Running Queries
Use the elastic CLI:
elastic es query 'FROM logs-* | WHERE @timestamp > NOW() - 1 HOUR | LIMIT 10'Common Patterns
Filter by time range:
FROM logs-*
| WHERE @timestamp > NOW() - 24 HOURSCount by field:
FROM logs-*
| STATS count = COUNT(*) BY service.name
| SORT count DESCPercentiles:
FROM metrics-apm*
| STATS p50 = PERCENTILE(transaction.duration.us, 50),
p95 = PERCENTILE(transaction.duration.us, 95),
p99 = PERCENTILE(transaction.duration.us, 99)
BY service.nameTime bucketing:
FROM logs-*
| WHERE log.level == "error"
| STATS errors = COUNT(*) BY bucket = BUCKET(@timestamp, 5 minute)
| SORT bucketMulti-field filtering:
FROM logs-*
| WHERE service.name == "api-gateway" AND http.response.status_code >= 500
| KEEP @timestamp, message, http.response.status_code, trace.id
| SORT @timestamp DESC
| LIMIT 50Type Functions
TO_STRING(field),TO_INTEGER(field),TO_DOUBLE(field)-- type conversionsDATE_TRUNC(interval, field)-- truncate timestampsCONCAT(a, b)-- string concatenationLENGTH(field)-- string lengthTRIM(field),LEFT(field, n),RIGHT(field, n)-- string manipulation
Aggregation Functions
COUNT(*),COUNT(field),COUNT_DISTINCT(field)SUM(field),AVG(field),MIN(field),MAX(field)PERCENTILE(field, pct),MEDIAN(field)VALUES(field)-- collect distinct values
Tips
- Always specify a time range with
WHERE @timestamp > NOW() - <duration>to avoid scanning too much data - Use
LIMITto control output size - Use
KEEPto select specific columns before output - Use
DROPto exclude columns - Use
RENAME old AS newto rename columns - Use
EVAL new_field = expressionto create computed columns - Use
DISSECTorGROKfor parsing unstructured text fields
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- elastic/agent-skills★ 583same name
- elastic/cursor-plugins★ 33same name
- elastic/claude-plugin★ 4same name
- elastic/elastic-aws-kiro-powers★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- packages/opencode/AGENTS.mdAGENTS.md
- packages/opencode/test/AGENTS.mdAGENTS.md
- elastic-cli-usageSkill
- observability-rcaSkill
- slo-managementSkill
- agents-sdkSkill
- cloudflareSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

