RousselTMLEARNING

Article · Kibana and Elastic Observability: from discovery to expertise

Machine learning: anomaly detection and AIOps

1. Machine learning features #

Overview.

What Elastic offers #

FeatureQuestionExample
Anomaly detectionwhat is out of the ordinary?drop in requests, unusual latency
Log rate analysiswhy this log spike?the fields that explain the spike
Log pattern analysiswhich kinds of messages?groups millions of lines into patterns
Change point detectionwhen did behaviour change?level shift after a deployment
Data frame analyticsclassify, predict, isolateoutlier detection, regression, classification
Trained modelsunderstand textELSER for semantic search, NER
Good to know: Anomaly detection and data frame analytics require a Platinum or Enterprise licence (or the 30-day trial) and nodes with the ml role.

Licence and trial #

LicenceWhat is available
Basic (free)Data Visualizer, file upload, viewing existing results
Trial (30 days)all machine learning features, as in Platinum / Enterprise
Platinum / Enterpriseanomaly detection, data frame analytics, trained models (NLP, ELSER), AIOps
GET _license                                   # type et date d'expiration
POST _license/start_trial?acknowledge=true     # essai de 30 jours, une seule fois par version majeure
Common mistake: Building production monitoring on the trial: when it expires, the cluster falls back to the Basic licence and anomaly detection jobs stop. Plan the subscription, or use threshold alert rules (free) for critical needs.
Depending on the version: the exact split of features between licences changes over time (AIOps, trained models): check Elastic's Subscriptions page for your version.

2. Creating a job #

Detectors and datafeed.

Concepts #

Indices, datafeed, job, results, alert.
ConceptRole
Detectorfunction + field: count, mean(latency), rare(process.name)…
bucket_spananalysis granularity (15 min by default)
partition_field / by_fieldone model per value (per service, per host)
Influencersfields explaining the anomaly (IP, URL, host)
Datafeedquery feeding the job, continuously or over history
PUT _ml/anomaly_detectors/latence-services
{
  "analysis_config": {
    "bucket_span": "15m",
    "detectors": [ { "function": "high_mean", "field_name": "transaction.duration.us", "partition_field_name": "service.name" } ],
    "influencers": ["service.name", "host.name"]
  },
  "data_description": { "time_field": "@timestamp" }
}
PUT _ml/datafeeds/datafeed-latence-services
{ "job_id": "latence-services", "indices": ["traces-apm*"] }
POST _ml/anomaly_detectors/latence-services/_open
POST _ml/datafeeds/datafeed-latence-services/_start

3. Reading and using results #

Score, explorer, alerts.

In Kibana #

  • Anomaly Explorer: view by influencer and period, colours by score (0 to 100).
  • Single Metric Viewer: the actual curve, the expected-behaviour band, anomalies and forecasts (_forecast).
  • Anomaly detection alert rule: notify above a score (for example 75) through a connector.
GET _ml/anomaly_detectors/latence-services/results/records?sort=record_score&desc=true&size=5
POST _ml/anomaly_detectors/latence-services/_forecast
{ "duration": "1d" }
Good practice: Let the model learn over several cycles (at least two weeks for a weekly rhythm) before alerting, and start with a high threshold.
Common mistake: Partitioning on a very high-cardinality field (session ID, full URL): model memory explodes and results become unreadable. Partition by service or host, and keep the rest as influencers.

4. Ready-made jobs #

Observability and Security.

Wizards #

Observability apps (APM, logs, infrastructure) and Security offer preconfigured jobs: abnormal APM latency, unusual log rate, rare processes on a host. Elastic Security also uses them as machine learning detection rules.

📄 Machine learning in Elastic: anomaly detection and AIOps →

My progress

  • ⏱ Estimated time : ≈ 6 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

Elastic Security: SIEM, detection rules and investigation

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

Elastic path project: centralising and using logs

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

Advanced Davis AI: anomaly detection, causal, predictive and generative AI

Understand Davis AI: static thresholds, auto-adaptive and seasonal baselines, causal analysis and...

Kibana and Elastic Observability best practices

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

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...

Logstash in production: persistent queues, DLQ and multiple pipelines

Make Logstash reliable in production: persistent queue, dead letter queue, multiple pipelines and...

Logstash: enrich, test, monitor and deploy on Kubernetes

Enrich with translate, geoip and elasticsearch, consume Kafka, test pipelines, monitor Logstash a...

Transforms and enrich: summarising and enriching data in Elasticsearch

Build entity-centric indices with pivot and latest transforms, and enrich documents at ingest tim...

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!