Settings from keystore doesnot load

I'm running OSS version of winlogbeat

I created winlogbeat keystore and stored ES_PWD using instructions available here

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

  # 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?

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

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

Thats how its specified in

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


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

1 Like

@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 "C:\ProgramData\winlogbeat" when you are calling the keystore subcommand.

winlogbeat keystore create `"C:\ProgramData\winlogbeat`"

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 "C:\ProgramData\metricbeat"

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