navigation_title: "{{esql}}" mapped_pages:
Elasticsearch Query Language ({{esql}}) is a piped query language for filtering, transforming, and analyzing data.
You can author {{esql}} queries to find specific events, perform statistical analysis, and create visualizations. It supports a wide range of commands, functions, and operators to perform various data operations, such as filter, aggregation, time-series analysis, and more. It initially supported a subset of the features available in Query DSL, but it is rapidly evolving with every {{serverless-full}} and Stack release.
{{esql}} is designed to be easy to read and write, making it accessible for users with varying levels of technical expertise. It is particularly useful for data analysts, security professionals, and developers who need to work with large datasets in Elasticsearch.
{{esql}} uses pipes (|
) to manipulate and transform data in a step-by-step fashion. This approach allows you to compose a series of operations, where the output of one operation becomes the input for the next, enabling complex data transformations and analysis.
Here's a simple example of an {{esql}} query:
FROM sample_data
| SORT @timestamp DESC
| LIMIT 3
Note that each line in the query represents a step in the data processing pipeline:
FROM
clause specifies the index or data stream to querySORT
clause sorts the data by the @timestamp
field in descending orderLIMIT
clause restricts the output to the top 3 resultsYou can interact with {{esql}} in two ways:
Programmatic access: Use {{esql}} syntax with the {{es}} _query
endpoint.
Interactive interfaces: Work with {{esql}} through Elastic user interfaces including Kibana Discover, Dashboards, Dev Tools, and analysis tools in Elastic Security and Observability.