# Logstash Can't read the elasticsearch username and password from Keystore!

**URL:** <https://discuss.elastic.co/t/logstash-cant-read-the-elasticsearch-username-and-password-from-keystore/291350>\
**Category:** Logstash\
**Tags:** elastic-stack-security\
**Created:** [December 9, 2021, 4:39pm UTC](https://discuss.elastic.co/t/logstash-cant-read-the-elasticsearch-username-and-password-from-keystore/291350 "2021-12-09T16:39:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maryam2021](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@Maryam2021](https://discuss.elastic.co/u/Maryam2021)\
**Post date:** [December 9, 2021, 4:39pm UTC](https://discuss.elastic.co/t/logstash-cant-read-the-elasticsearch-username-and-password-from-keystore/291350/1 "2021-12-09T16:39:32Z")

</div>

Hello All,

I'm trying to build ELK stack on EC2 instances. I have built the ES cluster, Kibana and Logstash. The cluster and Kibana are happy and talking to each other fine but can't figure out the keystore issue with Logstash. I have done the path.setting and added the keystore (etc/logstash/logstash.keystore) , changed the permission/ownership on it :  
(-rw------- 1 logstash root xxxxx /etc/logstash/logstash.keystore)  
added the ES\_PWD to it (it does list it)  
in my logstash.conf file I have password =\> "${ES\_PWD}"  
but when I run it (sudo /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/logstash.conf ) it returns this error :  
"Cannot evaluate `${ES_PWD}`. Replacement variable `ES_PWD` is not defined in a Logstash secret store or an environment entry and there is no default value given"

Please help!

---

<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:** [January 6, 2022, 4:39pm UTC](https://discuss.elastic.co/t/logstash-cant-read-the-elasticsearch-username-and-password-from-keystore/291350/2 "2022-01-06T16:39:34Z")

</div>

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