diff --git a/beater/connbeat.go b/beater/connbeat.go index 49ab5068..db33d2fe 100644 --- a/beater/connbeat.go +++ b/beater/connbeat.go @@ -27,7 +27,7 @@ type Connbeat struct { type ContainerInfo struct { id string - names []string + name string image string localIPs mapset.Set environment []string @@ -111,7 +111,7 @@ func toMap(containerInfo *ContainerInfo) common.MapStr { if containerInfo != nil { return common.MapStr{ "id": containerInfo.id, - "names": containerInfo.names, + "name": containerInfo.name, "image": containerInfo.image, "local_ips": containerInfo.localIPs.ToSlice(), "env": containerInfo.environment, @@ -178,7 +178,7 @@ func update(infos map[string]ContainerInfo, socketContainerInfo *sockets.Contain localIPs := mapset.NewSet() info = ContainerInfo{ socketContainerInfo.ID, - socketContainerInfo.Names, + socketContainerInfo.Name, socketContainerInfo.Image, localIPs, socketContainerInfo.DockerEnvironment, socketContainerInfo.Ports, diff --git a/sockets/docker/docker.go b/sockets/docker/docker.go index f05ecd8a..899408e5 100644 --- a/sockets/docker/docker.go +++ b/sockets/docker/docker.go @@ -155,7 +155,7 @@ func (p *Poller) getContainerInfo(container docker.APIContainers) (*sockets.Cont environment := p.getEnvironment(inspected) return &sockets.ContainerInfo{ ID: container.ID, - Names: container.Names, + Name: inspected.Name, Image: container.Image, DockerEnvironment: environment, Ports: inspected.NetworkSettings.Ports, diff --git a/sockets/sockets.go b/sockets/sockets.go index a47afab1..67ba0ba7 100644 --- a/sockets/sockets.go +++ b/sockets/sockets.go @@ -8,7 +8,7 @@ import ( type ContainerInfo struct { ID string - Names []string + Name string Image string DockerEnvironment []string Ports map[docker.Port][]docker.PortBinding