RousselTMLEARNING

Observability

Elastic Agent in production: best practices

Elastic Agent best practices: security, policy organisation, volume control, Fleet Server high availability, upgrades and fleet monitoring.

1. Security #

Protecting agents and data.

Rules #

Security, organisation, data, operations.
  • Verified TLS everywhere (Fleet Server, Elasticsearch, Logstash); never --insecure in production.
  • Enrollment tokens per policy, revoked after the initial rollout if no longer needed.
  • Integration secrets in Fleet secret fields; environment variables in standalone mode.
  • Uninstall protection on endpoints running Elastic Defend.

2. Organisation and volumes #

Staying readable and controlling costs.

Rules #

  • One policy per host role, one namespace per environment or team, tags for selections (upgrades, actions).
  • Disable unneeded streams of an integration (per-process metrics, debug logs).
  • Filter at the source (drop_event processors) or in the @custom pipeline.
  • Lifecycle policies (ILM) and retention tuned per data stream.

3. Operations #

A reliable fleet.

Rules #

  • At least two Fleet Servers behind a load balancer.
  • Agent monitoring enabled, alerting on offline or unhealthy agents.
  • Upgrades in batches after the stack, on a pilot batch first.
  • Versioned policies (YAML export, Fleet API or Terraform) to rebuild them identically.
# API Fleet : lister les agents hors ligne
curl -s -u elastic:$PASS "$KIBANA/api/fleet/agents?kuery=status:offline" -H 'kbn-xsrf: true' | jq '.items[].local_metadata.host.hostname'

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!