RousselTMLEARNING

Article · Elastic Agent: from discovery to expertise

Standalone mode, Logstash, Kafka and OpenTelemetry (EDOT)

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.

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

My progress

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

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!