Skip to content

[Elastic Agent] Agent doesn't write logs to updated Elasticsearch host #23596

@jen-huang

Description

@jen-huang

Summary

I noticed that when the ES host is updated in the agent yaml output, the change does not appear to be picked up by the agent for where to send its agent logs. Other data streams (like system ones) do appear to pick up the change and sends the data to the new location correctly.

outputs:
  default:
    type: elasticsearch
    hosts:
      - 'http://localhost:9201'

Steps

  1. Start Elasticsearch on non-default port, e.g. 9201
  2. Start Kibana with --elasticsearch.hosts=http://localhost:9201 flag to point to ES
  3. Enroll agent into Fleet with Default policy
  4. Observe that no data (no agent logs or any other data streams) is ingested because Fleet defaults incorrectly to port 9200 for ES
  5. Update Elasticsearch URL in Fleet settings flyout to the correct URL, http://localhost:9201
  6. Wait a bit for Default policy to update with new ES output and for enrolled agent to pick up the change
  7. Observe that system data streams start coming in, but Elastic Agent logs do not

If I uninstall that agent and enroll it again, the new agent does send its logs to the right ES, so it seems to only be a problem when the ES host is changed while the agent is already running.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions