# Can not connect Logstash to Elasticsearch

**URL:** https://discuss.elastic.co/t/can-not-connect-logstash-to-elasticsearch/345867
**Category:** Elasticsearch
**Tags:** elastic-stack-security
**Created:** [October 26, 2023, 8:40pm UTC](https://discuss.elastic.co/t/can-not-connect-logstash-to-elasticsearch/345867 "2023-10-26T20:40:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![liaotoca](https://avatars.discourse-cdn.com/v4/letter/l/b487fb/32.png) [@liaotoca](https://discuss.elastic.co/u/liaotoca)
#### Post date: [October 26, 2023, 8:40pm UTC](https://discuss.elastic.co/t/can-not-connect-logstash-to-elasticsearch/345867/1 "2023-10-26T20:40:00Z")

</div>

I follow the instructions here [Secure your connection to Elasticsearch | Logstash Reference [8.10] | Elastic](https://www.elastic.co/guide/en/logstash/current/ls-security.html) but if I did not put the username/password, logstash reported 401, if I put in the user name /password, the start up of logstash stalled at "Starting server on port: 5044"

Start command:

C:\ELK\logstash-8.10.4\>.\bin\logstash -f first-ssl-pipeline.conf --config.reload.automatic

The content of first-ssl-pipeline.conf:

input {  
beats {  
port =\> "5044"  
}  
}  
filter {  
grok {  
match =\> { "message" =\> "%{COMBINEDAPACHELOG}"}   
}  
}  
output {  
elasticsearch {  
hosts =\> ["[https://localhost:9200](https://localhost:9200)"]  
cacert =\> 'C:\ELK\logstash-8.10.4\config\certs\http\_ca.crt'  
user =\> logstash\_internal  
password =\> root123  
}  
}

---

<div class="post-metadata">

### Author: ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)
#### Post date: [October 29, 2023, 11:15am UTC](https://discuss.elastic.co/t/can-not-connect-logstash-to-elasticsearch/345867/2 "2023-10-29T11:15:16Z")

</div>

Why do you think it's stalled? Are you expecting additional messages?

It's been a while since I've run logstash, but I don't recall it being very verbose on startup.

---

<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: [November 26, 2023, 11:15am UTC](https://discuss.elastic.co/t/can-not-connect-logstash-to-elasticsearch/345867/3 "2023-11-26T11:15:51Z")

</div>

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