I have the following scenario that works:
FleetServer policy -> output type Elasticsearch
AgentPolicy -> output type Logstash
However if I try to change the output type for the Fleet Server policy, to Logstash I get an error and everything breaks down:
"c:\Program Files\Elastic\Agent\elastic-agent.exe" status
State: HEALTHY
Message: Running
Fleet State: FAILED
Fleet Message: fail to checkin to fleet-server: all hosts failed: 1 error occurred:
* requester 0/1 to host https://localhost:8221/ errored: Post "https://localhost:8221/api/fleet/agents/9bf8bc6c-4263-4c3a-af4c-24715c24ff72/checkin?": dial tcp [::1]:8221: connectex: No connection could be made because the target machine actively refused it.
Components:
* log (HEALTHY)
Healthy: communicating with pid '1296'
* winlog (HEALTHY)
Healthy: communicating with pid '6008'
* filestream (HEALTHY)
Healthy: communicating with pid '1372'
* beat/metrics (HEALTHY)
Healthy: communicating with pid '9028'
* http/metrics (HEALTHY)
Healthy: communicating with pid '10080'
* system/metrics (HEALTHY)
Healthy: communicating with pid '3076'
* (FAILED)
output not supported
I don't understand why is the agent trying to contact the fleet server on port 8221 and why the new * component which is not there in the case of the elasticsearch output.