# Heartbeat on Docker not receiving logs in Kibana

**URL:** <https://discuss.elastic.co/t/heartbeat-on-docker-not-receiving-logs-in-kibana/353130>\
**Category:** Beats\
**Tags:** docker, heartbeat\
**Created:** [February 13, 2024, 7:05am UTC](https://discuss.elastic.co/t/heartbeat-on-docker-not-receiving-logs-in-kibana/353130 "2024-02-13T07:05:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![roman-tasi](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@roman-tasi](https://discuss.elastic.co/u/roman-tasi)\
**Post date:** [February 13, 2024, 7:05am UTC](https://discuss.elastic.co/t/heartbeat-on-docker-not-receiving-logs-in-kibana/353130/1 "2024-02-13T07:05:48Z")

</div>

This is my config:

```auto
heartbeat.monitors:
- type: http
  enabled: true
  schedule: '@every 10s'
  urls: ["http://localhost:9200"] # Elasticsearch
- type: tcp
  enabled: true
  schedule: '@every 10s'
  hosts: ["localhost:5044"] # Logstash Beats input
- type: http
  enabled: true
  schedule: '@every 10s'
  urls: ["http://localhost:5601"] # Kibana
- type: http
  enabled: true
  schedule: '@every 10s'
  urls:
    - "http://localhost:2375/containers/json" # Docker API endpoint for listing containers

output.logstash:
  hosts: ["127.0.0.1:5044"] # Logstash Beats input

```

Instead of `localhost` I've also tried [10.100.10.36](https://10.100.10.36/) (the IP of the server) but isn't working. Checking `docker logs` I don't seem to have any errors. Any advice?

---

<div class="post-metadata">

**Author:** ![Alberto\_Delgado](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alberto_delgado/32/98488_2.png) [@Alberto\_Delgado](https://discuss.elastic.co/u/Alberto_Delgado)\
**Post date:** [February 13, 2024, 2:31pm UTC](https://discuss.elastic.co/t/heartbeat-on-docker-not-receiving-logs-in-kibana/353130/2 "2024-02-13T14:31:04Z")

</div>

Hi @roman-tasi,

Thanks for reaching out!

How are you executing heartbeat? Do you mean that you are not even seeing the HB logs when looking at the terminal? Have you tried to go inside the docker container and execute HB manually?

Are those addresses reachable within the docker container?

Thanks,  
Alberto

---

<div class="post-metadata">

**Author:** ![roman-tasi](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@roman-tasi](https://discuss.elastic.co/u/roman-tasi)\
**Post date:** [February 13, 2024, 10:46pm UTC](https://discuss.elastic.co/t/heartbeat-on-docker-not-receiving-logs-in-kibana/353130/3 "2024-02-13T22:46:50Z")

</div>

I am starting Heartbeat by running this command in the terminal:

```auto
docker run -d \
--name=heartbeat \
--user=root \
--volume="$(pwd)/heartbeat.docker.yml:/usr/share/heartbeat/heartbeat.yml:ro" \
--cap-add=NET_RAW \
docker.elastic.co/beats/heartbeat:8.12.1 \
--strict.perms=false -e \
-E output.logstash.hosts=["10.100.10.36:5044"]

```

I can see the HB logs by running `docker logs heartbeat --follow`

> Have you tried to go inside the docker container and execute HB manually?
> 
> Are those addresses reachable within the docker container?

I can enter the container by running `docker exec -it heartbeat sh` and see that the correct config is being applied, but not sure how to exactly answer your questions.

---

<div class="post-metadata">

**Author:** ![roman-tasi](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@roman-tasi](https://discuss.elastic.co/u/roman-tasi)\
**Post date:** [February 14, 2024, 7:49pm UTC](https://discuss.elastic.co/t/heartbeat-on-docker-not-receiving-logs-in-kibana/353130/4 "2024-02-14T19:49:57Z")

</div>

@Alberto_Delgado ^ Sorry to tag you

---

<div class="post-metadata">

**Author:** ![Alberto\_Delgado](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alberto_delgado/32/98488_2.png) [@Alberto\_Delgado](https://discuss.elastic.co/u/Alberto_Delgado)\
**Post date:** [February 15, 2024, 10:49am UTC](https://discuss.elastic.co/t/heartbeat-on-docker-not-receiving-logs-in-kibana/353130/5 "2024-02-15T10:49:28Z")

</div>

Hi @roman-tasi,

No problem with the tagging. Apologies for the delay!

I'm trying to understand what is the exact situation you are facing.

My understanding after seeing your second comment is that everything works well, meaning that you can see everything being executed locally, etc.

I'll try to configure a setup similar to yours locally and share with you the steps I followed. (and confirm that I'm seeing everything)

Before that, please, let me confirm your setup:

- using HB to ping a few URLs (with TCP and http)
- you are doing that locally through docker
- you are not setting the Elasticsearch output but the Logtash one instead.

Is this correct?

Btw, is Logtash running in your host or is it in another docker container?

Another thing that I need to confirm if possible:

When you say that you don't see the logs in Kibana, what logs are you referring to? Do you mean the results of the pings? (your http and TCP monitors) or do you mean other kinds of logs?

Could you share a screenshot of the page in Kibana where you are expecting to see those logs? I'm trying to have more context to provide you with a better guidance

Thanks,  
Alberto

---

<div class="post-metadata">

**Author:** ![Alberto\_Delgado](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alberto_delgado/32/98488_2.png) [@Alberto\_Delgado](https://discuss.elastic.co/u/Alberto_Delgado)\
**Post date:** [February 15, 2024, 10:57am UTC](https://discuss.elastic.co/t/heartbeat-on-docker-not-receiving-logs-in-kibana/353130/6 "2024-02-15T10:57:43Z")

</div>

Hi again,

To use Logtash output have you followed the steps mentioned in the part of the docs?

> **[Configure the Logstash output | Heartbeat Reference \[8.12\] | Elastic](https://www.elastic.co/guide/en/beats/heartbeat/current/logstash-output.html)**

For instance, have you followed this step?

" The `hosts` option specifies the Logstash server and the port (`5044`) where Logstash is configured to listen for incoming Beats connections.

For this configuration, you must [load the index template into Elasticsearch manually](https://www.elastic.co/guide/en/beats/heartbeat/current/heartbeat-template.html#load-template-manually) because the options for auto loading the template are only available for the Elasticsearch output."

P.S. Also might be interesting to check this: [Run Heartbeat on Docker | Heartbeat Reference [8.12] | Elastic](https://www.elastic.co/guide/en/beats/heartbeat/current/running-on-docker.html)

---

<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:** [March 14, 2024, 12:57pm UTC](https://discuss.elastic.co/t/heartbeat-on-docker-not-receiving-logs-in-kibana/353130/7 "2024-03-14T12:57:51Z")

</div>

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