RousselTMLEARNING

Article · Kibana and Elastic Observability: from discovery to expertise

Discover, KQL and ES|QL

1. Discover #

Everyday search.

Getting started #

  • Choose the data view and the time range (top right).
  • Add columns from the field list; clicking a field shows its 5 most frequent values.
  • Add filters in one click (+/-) from a document.
  • Save the search to reuse it in a dashboard or share it.

2. KQL and Lucene #

Filtering documents.

KQL #

service.name : "checkout" and http.response.status_code >= 500
message : "timeout" and not host.name : web-0*
log.level : (error or critical)
user_agent.original : *bot*
http.request.method : POST and url.path : "/api/panier"
NeedKQLLucene
Equalitystatus : 500status:500
Rangebytes >= 1000bytes:[1000 TO *]
Wildcardhost : web-*host:web-*
Regular expressionNohost:/web-[0-9]+/
Proximity, fuzzyNomessage:"erreur base"~3, timout~
Good practice: KQL is enough in 90% of cases and offers field autocompletion. Switch to Lucene only for regular expressions or fuzzy search.

3. ES|QL #

A step-by-step language.

Principle #

ES|QL (Elasticsearch Query Language) chains commands separated by |: you start from a source, filter, compute, aggregate, sort. It is available in Discover (ES|QL mode), in Lens and in alert rules.

FROM logs-*
| WHERE @timestamp > NOW() - 1 hour AND http.response.status_code >= 500
| STATS erreurs = COUNT(*) BY service.name
| SORT erreurs DESC
| LIMIT 10
FROM logs-*
| EVAL duree_s = event.duration / 1000000000
| STATS p95 = PERCENTILE(duree_s, 95), requetes = COUNT(*) BY url.path
| WHERE requetes > 100
| SORT p95 DESC
FROM logs-*
| GROK message "%{IP:client} %{WORD:methode} %{URIPATHPARAM:chemin} %{NUMBER:statut:int}"
| STATS total = COUNT(*) BY statut, BUCKET(@timestamp, 5 minutes)
Good to know: ES|QL can parse fields on the fly (GROK, DISSECT), enrich (ENRICH, LOOKUP JOIN depending on the version) and bucket time (BUCKET): many analyses no longer require a visualization.

📄 Exploring data in Discover: KQL, Lucene and ES|QL →

My progress

  • ⏱ Estimated time : ≈ 4 min

Sign in to track your progress and take notes. Sign in

💬 Questions about this lesson

No questions yet: be the first to ask for help or share your configuration.

Ask a question about this lesson →

Recommended Articles

Machine learning in Elastic: anomaly detection and AIOps

Automatically detect abnormal behaviour: anomaly detection jobs, datafeeds, detectors, influencer...

Kibana Maps and Canvas: geographic maps and presentations

Build maps with Kibana Maps (document, aggregation and choropleth layers, ES|QL) and dynamic pres...

Alerts, connectors and SLOs in Kibana

Create alert rules in Kibana (Elasticsearch query, ES|QL, custom threshold, logs), configure conn...

Kibana and Elastic Observability best practices

Checklist for running Kibana in production: versions, security, spaces and roles, versioned dashb...

Advanced Kibana: data views, Lens, dashboards, alerting and reporting

Use Kibana in depth: data views and runtime fields, Discover, Lens and formulas, dashboards and c...

Elastic Security: SIEM, detection rules and investigation

Use Elastic Security as a SIEM: ECS data sources, detection rule types (query, EQL, ES|QL, thresh...

Kibana: role, installation and first steps

What Kibana is in the Elastic suite, how to install it with Elasticsearch (start-local, Docker), ...

Visualizing in Kibana: Lens, dashboards and saved objects

Build visualizations with Lens, assemble interactive dashboards (filters, controls, links), and m...

Elastic path project: centralising and using logs

The validation project of the "Elastic Stack mastery" path: Elastic Agent and Fleet, Logstash, El...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!