# Logstash secuirty

**URL:** https://discuss.elastic.co/t/logstash-secuirty/280854
**Category:** Logstash
**Created:** [August 9, 2021, 11:14pm UTC](https://discuss.elastic.co/t/logstash-secuirty/280854 "2021-08-09T23:14:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Rickenson\_Robert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rickenson_robert/32/79007_2.png) [@Rickenson\_Robert](https://discuss.elastic.co/u/Rickenson_Robert)
#### Post date: [August 9, 2021, 11:14pm UTC](https://discuss.elastic.co/t/logstash-secuirty/280854/1 "2021-08-09T23:14:31Z")

</div>

After enabling xpack in the elasticsearch yml and setting passwords for elasticsearch I get the following error when trying to index into my elasticsearch cluster using logstash:

BadResponseCodeError, :message=\>"Got response code '401' contacting Elasticsearch at URL '[http://localhost:9200/](http://localhost:9200/)'"}

Does anyone know how to fix this problem?

Thank you,  
Rick

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [August 9, 2021, 11:42pm UTC](https://discuss.elastic.co/t/logstash-secuirty/280854/2 "2021-08-09T23:42:17Z")

</div>

What does your config look like?  
Have you tested the username and password you have configured with curl directly to Elasticsearch?

---

<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: [September 6, 2021, 11:42pm UTC](https://discuss.elastic.co/t/logstash-secuirty/280854/3 "2021-09-06T23:42:42Z")

</div>

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