# Not a valid Logstash keystore java exception problem

**URL:** https://discuss.elastic.co/t/not-a-valid-logstash-keystore-java-exception-problem/365362
**Category:** Logstash
**Created:** [August 22, 2024, 9:51am UTC](https://discuss.elastic.co/t/not-a-valid-logstash-keystore-java-exception-problem/365362 "2024-08-22T09:51:54Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Abdarrahmane](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@Abdarrahmane](https://discuss.elastic.co/u/Abdarrahmane)
#### Post date: [August 22, 2024, 3:55pm UTC](https://discuss.elastic.co/t/not-a-valid-logstash-keystore-java-exception-problem/365362/3 "2024-08-22T15:55:40Z")

</div>

Thank you somuch badger

It worked !

here is what i did

before creating the keystore and adding the secret username and password  
i went and creat the directory `/etc/sysconfig/` and a logstash file in it with the value of `LOGSTASH_KEYSTORE_PASS`  
here are the commands :

```auto
sudo systemctl stop logstash.service 
sudo mkdir /etc/sysconfig
sudo nano /etc/sysconfig/logstash
add the following (replace with actual password): 
LOGSTASH_KEYSTORE_PASS=mypassword
sudo chmod 600 /etc/sysconfig/logstash

```

Then created my keystore and continued with the steps as described above

but i'm still wondring, it is secure to have a file storing such a value in sysconfig ?

---

_[View the full topic](https://discuss.elastic.co/t/not-a-valid-logstash-keystore-java-exception-problem/365362)._
