RousselTMLEARNING

Observability

Standalone Elastic Agent, Logstash and Kafka outputs, and OpenTelemetry (EDOT)

Write a standalone configuration, ship to Logstash or Kafka, and use Elastic Agent as an OpenTelemetry Collector (EDOT distribution) to collect logs, metrics and traces in OTel format.

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: 30s
Good 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 #

Direct, through Logstash or through Kafka.
OutputWhen
ElasticsearchGeneral case: simple and fastest
LogstashComplex transformations, external enrichment, routing to several destinations
KafkaDurable 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 #

Applications and host send to the EDOT Collector, which writes to Elasticsearch in OpenTelemetry format.

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

Related articles

Elastic Agent: architecture, Fleet and integrations

Understand Elastic Agent: single collection agent, Fleet and Fleet Server, agent policies, integrations, data…

Elastic Agent or Beats? Choosing and migrating

Compare Elastic Agent and Beats (Filebeat, Metricbeat, Winlogbeat), know when to keep Beats, and migrate step…

Installing Fleet Server and enrolling Elastic Agents

Set up Fleet Server, create a policy, enroll Linux, Windows and Docker agents, understand tokens and certific…

Keep learning

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!