# Settings from keystore doesnot load

**URL:** https://discuss.elastic.co/t/settings-from-keystore-doesnot-load/182321
**Category:** Beats
**Created:** [May 22, 2019, 8:28pm UTC](https://discuss.elastic.co/t/settings-from-keystore-doesnot-load/182321 "2019-05-22T20:28:15Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Thanura\_Kannangara](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Thanura\_Kannangara](https://discuss.elastic.co/u/Thanura_Kannangara)
#### Post date: [May 22, 2019, 8:28pm UTC](https://discuss.elastic.co/t/settings-from-keystore-doesnot-load/182321/1 "2019-05-22T20:28:15Z")

</div>

I'm running OSS version of winlogbeat  
winlogbeat-oss-6.7.1-windows-x86\_64

I created winlogbeat keystore and stored ES\_PWD using instructions available [here](https://www.elastic.co/guide/en/beats/winlogbeat/6.7/keystore.html)

and I'm using refering to the key as mentioned in the above mentioned article as below

```
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["https://<HostDNS>:9200"]
  ssl.verification_mode: "none"
  username: "admin"
  password: ${ES_PWD}
 # password: "${ES_PWD}" <-- tried this too

```

However, i can't get WInlogbeat started with this config as it gives me below error

`2019-05-22T20:11:50.339Z	ERROR	instance/beat.go:906	Exiting: error initializing publisher: missing field accessing 'output.elasticsearch.password' (source:'C:\Program Files\winlogbeat\winlogbeat-6.7.1-windows-x86_64\winlogbeat.yml')`

However, when i provide plain-text password it works

What am I doing wrong?

---

<div class="post-metadata">

### Author: ![Thanura\_Kannangara](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Thanura\_Kannangara](https://discuss.elastic.co/u/Thanura_Kannangara)
#### Post date: [May 22, 2019, 8:56pm UTC](https://discuss.elastic.co/t/settings-from-keystore-doesnot-load/182321/2 "2019-05-22T20:56:32Z")

</div>

Note: same issue happens on Metricbeat as well,

Im suspecting that service doesnot know where is the keystore, is Keystore hardcoded to a path?  
right now i can see the keystore file is available hre  
C:\Program Files\winlogbeat\winlogbeat-6.7.1-windows-x86\_64\data\winlogbeat.keystore

similar location on Metricbeat

---

<div class="post-metadata">

### Author: ![Thanura\_Kannangara](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Thanura\_Kannangara](https://discuss.elastic.co/u/Thanura_Kannangara)
#### Post date: [May 22, 2019, 9:34pm UTC](https://discuss.elastic.co/t/settings-from-keystore-doesnot-load/182321/3 "2019-05-22T21:34:48Z")

</div>

Found the root cause  
For some reason, windows service thinks path.data is in below location  
-path.data `"C:\ProgramData\winlogbeat`"

Thats how its specified in  
"install-service-winlogbeat.ps1"

but, when we generate the keystore it get stored in below location  
C:\Program Files\winlogbeat\winlogbeat-6.7.1-windows-x86\_64\data

if I copy the newly generated keystore to C:\ProgramData\winlogbeat and start the service, everything works fine..

Is this a bug, or im not doing something right

Note:

when I generate the keystore/ add keys  
I CDed to this folder and ran the commands like this  
\> cd C:\Program Files\winlogbeat\winlogbeat-6.7.1-windows-x86\_64  
\> echo " ThePass " | .\winlogbeat.exe keystore add ES\_PWD --stdin

---

<div class="post-metadata">

### Author: ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)
#### Post date: [May 23, 2019, 1:10am UTC](https://discuss.elastic.co/t/settings-from-keystore-doesnot-load/182321/4 "2019-05-23T01:10:46Z")

</div>

@Thanura_Kannangara Did you use the `install-service-winlogbeat.ps1` script to install winlogbeat? if this is the case you have to add the option `-path.data "C:\ProgramData\winlogbeat`" when you are calling the keystore subcommand.

```auto
winlogbeat keystore create -path.data `"C:\ProgramData\winlogbeat`"

```

---

<div class="post-metadata">

### Author: ![Thanura\_Kannangara](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@Thanura\_Kannangara](https://discuss.elastic.co/u/Thanura_Kannangara)
#### Post date: [May 23, 2019, 5:19pm UTC](https://discuss.elastic.co/t/settings-from-keystore-doesnot-load/182321/5 "2019-05-23T17:19:47Z")

</div>

Thanks @pierhugues  
for anyone else who run into this issue,  
below command will work.  
Even you don't create the the keystore first, this will create the keystore in correct location and add the new key

> echo "Password123" | .\metricbeat.exe keystore add ES\_PWD --stdin --force --path.data `"C:\ProgramData\metricbeat`"

---

<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: [June 20, 2019, 5:19pm UTC](https://discuss.elastic.co/t/settings-from-keystore-doesnot-load/182321/6 "2019-06-20T17:19:48Z")

</div>

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