# FileBeat Connection error to elastic search

**URL:** https://discuss.elastic.co/t/filebeat-connection-error-to-elastic-search/176538
**Category:** Elasticsearch
**Created:** [April 12, 2019, 5:02am UTC](https://discuss.elastic.co/t/filebeat-connection-error-to-elastic-search/176538 "2019-04-12T05:02:06Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![KK23](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kk23/32/43993_2.png) [@KK23](https://discuss.elastic.co/u/KK23)
#### Post date: [April 12, 2019, 5:02am UTC](https://discuss.elastic.co/t/filebeat-connection-error-to-elastic-search/176538/1 "2019-04-12T05:02:06Z")

</div>

Getting below errors in FileBeat after starting filebeat  
ERROR pipeline/output.go:100 Failed to connect to backoff(elasticsearch([http://localhost:9200](http://localhost:9200))): Get [http://localhost:9200](http://localhost:9200): EOF

Filebeat config file has this  
output.elasticsearch:

# Array of hosts to connect to.

hosts: ["localhost:9200"]

I also tried https but no luck

curl -v -k -XGET '[https://localhost:9200/filebeat-\*/\_search?pretty](https://localhost:9200/filebeat-*/_search?pretty)' -u username:password works  
and returns values

I have setup kibana and that is fine  
Only Filebeat set up is causing so much issues, it looks straight forward to set up but its not working

Appreciate some help from someone please as i would really like this to run and seems to be the final blocker in having an EFK stack up and running.

Thanks,  
Karthik

---

<div class="post-metadata">

### Author: ![harshbajaj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshbajaj16/32/44970_2.png) [@harshbajaj16](https://discuss.elastic.co/u/harshbajaj16)
#### Post date: [April 12, 2019, 5:47am UTC](https://discuss.elastic.co/t/filebeat-connection-error-to-elastic-search/176538/2 "2019-04-12T05:47:27Z")

</div>

Hi @KK23,

Could you please help me to understand your environment ?

On which platform you are working?  
Are you running elasticsearch on same node ?  
is elasticsearch service in running state ?

Could you please share the elasticsearch.yml and filebeat.yml file here so that i can identify the issue??

Br,  
Harsh Bajaj

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [April 12, 2019, 6:00am UTC](https://discuss.elastic.co/t/filebeat-connection-error-to-elastic-search/176538/3 "2019-04-12T06:00:12Z")

</div>

Based on the curl command that works it looks like you need to configure Filebeat to use https and also configure a username and password. Have you tried this? If so can you show your config? Please make sure you format it properly.

---

<div class="post-metadata">

### Author: ![KK23](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kk23/32/43993_2.png) [@KK23](https://discuss.elastic.co/u/KK23)
#### Post date: [April 12, 2019, 6:59am UTC](https://discuss.elastic.co/t/filebeat-connection-error-to-elastic-search/176538/4 "2019-04-12T06:59:09Z")

</div>

yep i tried this as well in filebeat.yml  
protocol: "https"  
username: abc  
password: abc

username and password details just dummy ones listed above  
but this method also not working

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [April 12, 2019, 7:33am UTC](https://discuss.elastic.co/t/filebeat-connection-error-to-elastic-search/176538/5 "2019-04-12T07:33:11Z")

</div>

How did you specify the `host` when you specified `protocol`? Did you follow one of [these examples](https://www.elastic.co/guide/en/beats/filebeat/current/elasticsearch-output.html)?

---

<div class="post-metadata">

### Author: ![KK23](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kk23/32/43993_2.png) [@KK23](https://discuss.elastic.co/u/KK23)
#### Post date: [April 12, 2019, 7:42am UTC](https://discuss.elastic.co/t/filebeat-connection-error-to-elastic-search/176538/6 "2019-04-12T07:42:40Z")

</div>

yep i tried everything in that page before as well so its a puzzle its not working:confused: not sure why though

---

<div class="post-metadata">

### Author: ![KK23](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kk23/32/43993_2.png) [@KK23](https://discuss.elastic.co/u/KK23)
#### Post date: [April 12, 2019, 7:43am UTC](https://discuss.elastic.co/t/filebeat-connection-error-to-elastic-search/176538/7 "2019-04-12T07:43:48Z")

</div>

hello,  
this is a test environment  
filebeat.yml has this  
output.elasticsearch:

# Array of hosts to connect to.

hosts: ["localhost:9200"]  
protocol: "https"  
username: abc  
password: abc

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [April 12, 2019, 7:43am UTC](https://discuss.elastic.co/t/filebeat-connection-error-to-elastic-search/176538/8 "2019-04-12T07:43:56Z")

</div>

Can you show the exact configuration you tried using username and password?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [April 12, 2019, 7:45am UTC](https://discuss.elastic.co/t/filebeat-connection-error-to-elastic-search/176538/9 "2019-04-12T07:45:57Z")

</div>

I see that you run curl with -k flag. Can you enable debug logging and check if Filebeat has any problem with the certificate?

Maybe try setting [verification\_mode](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-ssl.html) in your config?

---

<div class="post-metadata">

### Author: ![KK23](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kk23/32/43993_2.png) [@KK23](https://discuss.elastic.co/u/KK23)
#### Post date: [April 12, 2019, 7:53am UTC](https://discuss.elastic.co/t/filebeat-connection-error-to-elastic-search/176538/10 "2019-04-12T07:53:43Z")

</div>

seems like a limit of characters that can be posted i cant post the full config file details

---

<div class="post-metadata">

### Author: ![KK23](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kk23/32/43993_2.png) [@KK23](https://discuss.elastic.co/u/KK23)
#### Post date: [April 12, 2019, 7:58am UTC](https://discuss.elastic.co/t/filebeat-connection-error-to-elastic-search/176538/11 "2019-04-12T07:58:25Z")

</div>

Is it possible to share your working filebeat config without username and password but the rest of the details which can serve as a reference.

thanks,  
KK

---

<div class="post-metadata">

### Author: ![KK23](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kk23/32/43993_2.png) [@KK23](https://discuss.elastic.co/u/KK23)
#### Post date: [April 12, 2019, 8:21am UTC](https://discuss.elastic.co/t/filebeat-connection-error-to-elastic-search/176538/12 "2019-04-12T08:21:56Z")

</div>

i get Get [http://localhost:9200](http://localhost:9200): EOF in the file beat log i am not using https and also i am now using filebeat reference yml so i was expecting it to work

---

<div class="post-metadata">

### Author: ![KK23](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kk23/32/43993_2.png) [@KK23](https://discuss.elastic.co/u/KK23)
#### Post date: [April 12, 2019, 8:38am UTC](https://discuss.elastic.co/t/filebeat-connection-error-to-elastic-search/176538/13 "2019-04-12T08:38:36Z")

</div>

Ok its working your answer helped me but now i have a different error to figure out now 😀

Exiting: 1 error: Error checking if xpack is available: 500 Internal Server Error: {"error":{"root\_cause":[{"type":"security\_exception","reason":"Unexpected exception indices:admin/get"}],"type":"security\_exception","reason":"Unexpected exception indices:admin/get"},"status":500}

---

<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 10, 2019, 8:38am UTC](https://discuss.elastic.co/t/filebeat-connection-error-to-elastic-search/176538/14 "2019-05-10T08:38:40Z")

</div>

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