How to get details of fleet server

How can I list number/name of hosts connected to any specific Fleet server.

Hi @Nishant_Chauhan, have you checked the Fleet API documentation? I understand you want to query the GET /agents endpoint

This worked for me:

➜ curl -ks --request GET \
  --user "${ELASTIC_USER}:${ELASTIC_PASSWORD}" \
  --url "${KIBANA_HOST}/api/fleet/agents" \
  --header 'Content-Type: application/json' \
  | jq ".items[].id"
"c4e7c3ca-..."
"0591c27c-..."
"b1af37e0-..."

Thanks @jsanz !
This is good, however I want the list of agents talking to a particular fleet server.

Like i am able to get the fleet server name, but i want to list the agents talking to this fleet.

curl -ks --request GET \
  --user "username:password" \
  --url "http://0.0.0.0:5601/api/fleet/fleet_server_hosts" \
  --header 'Content-Type: application/json' \
  | jq
{
  "items": [
    {
      "id": "beb26a70-26d4-11ee-8fec-b977c4acee53",
      "name": "fleet1",
      "host_urls": [
        "https://x.x.x.x:8220"
      ],
      "is_default": true,
      "is_preconfigured": false
    }
  ],
  "page": 1,
  "perPage": 10000,
  "total": 1
}

I want to know hostnames of all agents talking/connected to "fleet1"

Hi sorry for my misunderstanding, yeah I don't think the fleet host is exposed in the Agents API and support for multiple Fleet server was added not that long ago so there may be opportunities to improve it.

Check this discussion so it provides some background

You may want to open a feature request there with this requirement.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.