1. Standalone configuration #
Everything in elastic-agent.yml.
Minimal example #
outputs:
default:
type: elasticsearch
hosts: ["https://es.exemple.fr:9200"]
api_key: "${ES_API_KEY}"
ssl.certificate_authorities: [/etc/pki/ca.crt]
inputs:
- id: system-logs
type: filestream
use_output: default
data_stream.namespace: prod
streams:
- id: syslog
data_stream.dataset: system.syslog
paths: [/var/log/syslog, /var/log/messages]
- id: system-metrics
type: system/metrics
use_output: default
data_stream.namespace: prod
streams:
- metricsets: [cpu, memory, filesystem, network]
data_stream.dataset: system.cpu
period: 30sGood to know: In standalone mode, install integration assets (pipelines, mappings, dashboards) from Kibana › Integrations › Settings, otherwise data arrives unstructured.
2. Logstash and Kafka outputs #
When to use an intermediary.
Choosing #
| Output | When |
|---|---|
| Elasticsearch | General case: simple and fastest |
| Logstash | Complex transformations, external enrichment, routing to several destinations |
| Kafka | Durable buffer, producer and consumer decoupling, very high volumes |
Logstash #
# Logstash : entrée dédiée aux agents
input {
elastic_agent { port => 5044 ssl_enabled => true ssl_certificate => "/etc/pki/ls.crt" ssl_key => "/etc/pki/ls.key" }
}
output {
elasticsearch { hosts => ["https://es.exemple.fr:9200"] data_stream => true api_key => "${LS_API_KEY}" }
}3. OpenTelemetry with EDOT #
The Collector distributed by Elastic.
The otel mode #
Elastic publishes EDOT (Elastic Distribution of OpenTelemetry): a Collector and SDKs supported by Elastic. The Elastic Agent binary can run this Collector with elastic-agent otel: data is stored in native OpenTelemetry format (resource.attributes.*, attributes.* fields) in dedicated data streams.
sudo elastic-agent otel --config /etc/elastic-agent/otel.yml
# ou valider la configuration
elastic-agent otel validate --config /etc/elastic-agent/otel.ymlDepending on the version: Elastic Agent's OpenTelemetry mode and Fleet management of EDOT evolve quickly between 8.x and 9.x: check your version's documentation before using it in production. The « OpenTelemetry and Elasticsearch » chapter of the Elasticsearch course details the configurations.
My progress
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.
Recommended Articles
Elastic Agent: architecture, Fleet and integrations
Understand Elastic Agent: single collection agent, Fleet and Fleet Server, agent policies, integr...
Installing Fleet Server and enrolling Elastic Agents
Set up Fleet Server, create a policy, enroll Linux, Windows and Docker agents, understand tokens ...
Agent policies, integrations, data streams and pipelines
Build agent policies, add integrations (System, Nginx, Custom Logs), choose namespaces, customise...
Elastic Agent or Beats? Choosing and migrating
Compare Elastic Agent and Beats (Filebeat, Metricbeat, Winlogbeat), know when to keep Beats, and ...
Elastic Agent on Kubernetes
Deploy Elastic Agent on Kubernetes: Fleet-managed DaemonSet, Kubernetes integration, kube-state-m...
Monitoring, upgrading and troubleshooting Elastic Agent
Operate an Elastic Agent fleet: states in Fleet, agent monitoring, batch upgrades, diagnostics, l...
Elastic Agent in production: best practices
Elastic Agent best practices: security, policy organisation, volume control, Fleet Server high av...
OpenTelemetry and Elasticsearch: compatibility and architecture
Send OpenTelemetry to Elasticsearch: Collector and elasticsearch exporter, managed OTLP endpoint,...
Ingesting OpenTelemetry logs into Elasticsearch
Collect and structure logs with the OpenTelemetry Collector (filelog receiver, operators, transfo...