# Filebeat can't connect to Elastic search

**URL:** <https://discuss.elastic.co/t/filebeat-cant-connect-to-elastic-search/358873>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 6, 2024, 9:47pm UTC](https://discuss.elastic.co/t/filebeat-cant-connect-to-elastic-search/358873 "2024-05-06T21:47:33Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![ddiabe](https://avatars.discourse-cdn.com/v4/letter/d/ea5d25/32.png) [@ddiabe](https://discuss.elastic.co/u/ddiabe)\
**Post date:** [May 8, 2024, 10:24pm UTC](https://discuss.elastic.co/t/filebeat-cant-connect-to-elastic-search/358873/21 "2024-05-08T22:24:24Z")

</div>

Yes docker is running.. output above,

ls1 is my local host.

```auto
 sudo docker inspect lme_elasticsearch.1.v6w6ytregj5ttdhr4xx7vkgil | grep "Running"
            "Running": true,

```

---

<div class="post-metadata">

**Author:** ![ddiabe](https://avatars.discourse-cdn.com/v4/letter/d/ea5d25/32.png) [@ddiabe](https://discuss.elastic.co/u/ddiabe)\
**Post date:** [May 8, 2024, 10:29pm UTC](https://discuss.elastic.co/t/filebeat-cant-connect-to-elastic-search/358873/22 "2024-05-08T22:29:11Z")

</div>

that also shows that my ES is running..  
@stephenb am thinking my issue is probably coming from the filebeat config file , i posted it above.  
So here is what i am trying to do.  
I am trying to export audit logs my host (DC) to target (ES)using filbeat.  
Logs ---\>logstash----\>ES----\>kibana

---

<div class="post-metadata">

**Author:** ![ddiabe](https://avatars.discourse-cdn.com/v4/letter/d/ea5d25/32.png) [@ddiabe](https://discuss.elastic.co/u/ddiabe)\
**Post date:** [May 8, 2024, 10:34pm UTC](https://discuss.elastic.co/t/filebeat-cant-connect-to-elastic-search/358873/23 "2024-05-08T22:34:13Z")

</div>

@Rios thank you, i will try that as well.

---

<div class="post-metadata">

**Author:** ![ddiabe](https://avatars.discourse-cdn.com/v4/letter/d/ea5d25/32.png) [@ddiabe](https://discuss.elastic.co/u/ddiabe)\
**Post date:** [May 8, 2024, 10:37pm UTC](https://discuss.elastic.co/t/filebeat-cant-connect-to-elastic-search/358873/24 "2024-05-08T22:37:17Z")

</div>

```auto
PS C:\Program Files\filebeat-8.13.2-windows-x86_64> notepad.exe .\filebeat.yml
PS C:\Program Files\filebeat-8.13.2-windows-x86_64> .\filebeat test config
Config OK
PS C:\Program Files\filebeat-8.13.2-windows-x86_64> .\filebeat test output
elasticsearch: http://ls1:9200...
  parse url... OK
  connection...
    parse host... OK
    dns lookup... OK
    addresses: 10.1.0.5
    dial up... OK
  TLS... WARN secure connection disabled
  talk to server... ERROR Get "http://ls1:9200": EOF
PS C:\Program Files\filebeat-8.13.2-windows-x86_64>

when i run the filebeat test config and filebeat test output, that is the result i get.

```

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [May 8, 2024, 11:34pm UTC](https://discuss.elastic.co/t/filebeat-cant-connect-to-elastic-search/358873/25 "2024-05-08T23:34:56Z")

</div>

You need to share your entire Docker compose

Also I always recommend getting

Logs -\> Filebeat -\> Elasticsearch

Working First before trying

Logs -\> Filebeat -\> Logstash -\> Elasticsearch

Also I suspect  
`https://ls1:9200`

is the logstash container not the elasticsearch container

---

<div class="post-metadata">

**Author:** ![ddiabe](https://avatars.discourse-cdn.com/v4/letter/d/ea5d25/32.png) [@ddiabe](https://discuss.elastic.co/u/ddiabe)\
**Post date:** [May 10, 2024, 4:41pm UTC](https://discuss.elastic.co/t/filebeat-cant-connect-to-elastic-search/358873/26 "2024-05-10T16:41:58Z")

</div>

@stephenb used Winlogbeat to push the logs to Elk stack, it was much easier. Thanks for all the support.

[Previous page](https://discuss.elastic.co/t/filebeat-cant-connect-to-elastic-search/358873.md?page=1)
