# Filebeat fails with connecting to Kibana over GET 127.0.0.1:5601

**URL:** https://discuss.elastic.co/t/filebeat-fails-with-connecting-to-kibana-over-get-127-0-0-1-5601/269193
**Category:** Beats
**Tags:** filebeat
**Created:** [April 4, 2021, 4:44pm UTC](https://discuss.elastic.co/t/filebeat-fails-with-connecting-to-kibana-over-get-127-0-0-1-5601/269193 "2021-04-04T16:44:39Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![makrellen](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@makrellen](https://discuss.elastic.co/u/makrellen)
#### Post date: [April 4, 2021, 4:44pm UTC](https://discuss.elastic.co/t/filebeat-fails-with-connecting-to-kibana-over-get-127-0-0-1-5601/269193/1 "2021-04-04T16:44:39Z")

</div>

**Description of problem**

I'm trying to get Filebeat to work on my Ubuntu VPS via docker-compose and I've set it up behind my caddy-reverse proxy and configured everything as I should according to the Filebeat docs, but I keep getting the same errror attached below. All my other docker-containers behind the reverse-proxy works fine, so my stack-setup is working.

**error:**

> Exiting: error connecting to Kibana: fail to get the Kibana version: HTTP GET request to [http://localhost:5601/api/status](http://localhost:5601/api/status) fails: fail to execute the HTTP GET request: Get "[http://localhost:5601/api/status](http://localhost:5601/api/status)": dial tcp 127.0.0.1:5601: connect: connection refused. Response: .

**docker-compose.yml**

> version: '3.8'
> 
> services:  
> filebeat:  
> image: [docker.elastic.co/beats/filebeat:7.12.0](http://docker.elastic.co/beats/filebeat:7.12.0)  
> container\_name: filebeat  
> expose:  
> - 5601  
> volumes:  
> - /home/ubuntu/filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro  
> - /var/run/docker.sock:/var/run/docker.sock  
> - /var/lib/docker/containers:/var/lib/docker/containers:ro  
> networks:  
> - main  
> restart: always
> 
> networks:  
> main:  
> external: true

**Filebeat.yml**

> filebeat.config:  
> modules:  
> path: ${path.config}/modules.d/\*.yml  
> reload.enabled: true
> 
> setup.dashboards.enabled: true  
> setup.kibana.host: "[http://localhost:5601](http://localhost:5601)"
> 
> filebeat.inputs:
> 
> - type: docker  
> containers.ids: '\*'
> 
> output.console:  
> pretty: true

**Caddyfile reverse proxy config**

> [filebeat.mydomain.me](http://filebeat.mydomain.me) {  
> reverse\_proxy filebeat:5601  
> }

---

<div class="post-metadata">

### Author: ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)
#### Post date: [April 8, 2021, 1:51am UTC](https://discuss.elastic.co/t/filebeat-fails-with-connecting-to-kibana-over-get-127-0-0-1-5601/269193/2 "2021-04-08T01:51:10Z")

</div>

What port is the reverse proxy listening on? Is that running in docker too?

---

<div class="post-metadata">

### Author: ![makrellen](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@makrellen](https://discuss.elastic.co/u/makrellen)
#### Post date: [April 8, 2021, 10:05am UTC](https://discuss.elastic.co/t/filebeat-fails-with-connecting-to-kibana-over-get-127-0-0-1-5601/269193/3 "2021-04-08T10:05:25Z")

</div>

Caddy is running as docker too on the same docker-network as every other docker container.  
Its listening on 80:80 and 443:443

---

<div class="post-metadata">

### Author: ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)
#### Post date: [April 8, 2021, 11:48am UTC](https://discuss.elastic.co/t/filebeat-fails-with-connecting-to-kibana-over-get-127-0-0-1-5601/269193/4 "2021-04-08T11:48:14Z")

</div>

Also is the error you posted from Filebeat? Just to confirm, is that your entire docker-compose? If so, it looks like you are only running filebeat, you don't have a kibana container. You appear to be exposing port 5601 on the Filebeat container.

---

<div class="post-metadata">

### Author: ![makrellen](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@makrellen](https://discuss.elastic.co/u/makrellen)
#### Post date: [April 8, 2021, 11:52am UTC](https://discuss.elastic.co/t/filebeat-fails-with-connecting-to-kibana-over-get-127-0-0-1-5601/269193/5 "2021-04-08T11:52:06Z")

</div>

Yes the error comes from the filebeat container when running `docker-compose up -d` and then `docker logs filebeat` to read the logs of the container.

Yes its also the entire docker-compose. My suspicsion is that Kibana is not running and not part of the Filebeat image, but I understood it as Kibana is built in to Filebeat, so one could view the logs in a dashboard

---

<div class="post-metadata">

### Author: ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)
#### Post date: [April 8, 2021, 12:32pm UTC](https://discuss.elastic.co/t/filebeat-fails-with-connecting-to-kibana-over-get-127-0-0-1-5601/269193/6 "2021-04-08T12:32:45Z")

</div>

no kibana is its own application. its available in its own container [kibana | Docker @ Elastic](https://www.docker.elastic.co/r/kibana).

---

<div class="post-metadata">

### Author: ![makrellen](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@makrellen](https://discuss.elastic.co/u/makrellen)
#### Post date: [April 8, 2021, 6:50pm UTC](https://discuss.elastic.co/t/filebeat-fails-with-connecting-to-kibana-over-get-127-0-0-1-5601/269193/8 "2021-04-08T18:50:34Z")

</div>

I'm still stuck with the same problem, but when I enter the kibana frontend through the browser I see this message on the page: _Kibana server is not ready yet_.

This is my new docker-compose file

> version: '3.8'
> 
> services:  
> filebeat:  
> image: [docker.elastic.co/beats/filebeat:7.12.0](http://docker.elastic.co/beats/filebeat:7.12.0)  
> container\_name: filebeat  
> volumes:  
> - /home/ubuntu/filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml  
> - /var/run/docker.sock:/var/run/docker.sock  
> - /var/lib/docker/containers:/var/lib/docker/containers:ro  
> depends\_on:  
> - kibana  
> networks:  
> - main  
> restart: always
> 
> kibana:  
> image: [docker.elastic.co/kibana/kibana:7.12.0](http://docker.elastic.co/kibana/kibana:7.12.0)  
> container\_name: kibana  
> expose:  
> - 5601  
> networks:  
> - main  
> restart: always
> 
> networks:  
> main:  
> external: true

**The error**

> 2021-04-08T18:49:10.054Z ERROR instance/beat.go:971 Exiting: error connecting to Kibana: fail to get the Kibana version: HTTP GET request to [http://0.0.0.0:5601/api/status](http://0.0.0.0:5601/api/status) fails: fail to execute the HTTP GET request: Get "[http://0.0.0.0:5601/api/status](http://0.0.0.0:5601/api/status)": dial tcp 0.0.0.0:5601: connect: connection refused. Response: .
> 
> Exiting: error connecting to Kibana: fail to get the Kibana version: HTTP GET request to [http://0.0.0.0:5601/api/status](http://0.0.0.0:5601/api/status) fails: fail to execute the HTTP GET request: Get "[http://0.0.0.0:5601/api/status](http://0.0.0.0:5601/api/status)": dial tcp 0.0.0.0:5601: connect: connection refused. Response: .

**filebeat.yml**

> filebeat.config:  
> modules:  
> path: ${path.config}/modules.d/\*.yml  
> reload.enabled: false
> 
> setup.dashboards.enabled: true  
> setup.kibana.host: "0.0.0.0:5601"
> 
> filebeat.inputs:
> 
> - type: docker  
> containers.ids: '\*'
> 
> output.console:  
> pretty: true

---

<div class="post-metadata">

### Author: ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)
#### Post date: [April 8, 2021, 7:10pm UTC](https://discuss.elastic.co/t/filebeat-fails-with-connecting-to-kibana-over-get-127-0-0-1-5601/269193/9 "2021-04-08T19:10:45Z")

</div>

Do u have a elasicsearch container/server running?? that's where teh data is actually stored. Kibana is just a UI for it.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [May 6, 2021, 9:11pm UTC](https://discuss.elastic.co/t/filebeat-fails-with-connecting-to-kibana-over-get-127-0-0-1-5601/269193/10 "2021-05-06T21:11:25Z")

</div>

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