# Winlogbeat keystore windows

**URL:** https://discuss.elastic.co/t/winlogbeat-keystore-windows/268769
**Category:** Beats
**Tags:** winlogbeat
**Created:** [March 30, 2021, 10:18am UTC](https://discuss.elastic.co/t/winlogbeat-keystore-windows/268769 "2021-03-30T10:18:33Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![probson](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@probson](https://discuss.elastic.co/u/probson)
#### Post date: [March 30, 2021, 10:18am UTC](https://discuss.elastic.co/t/winlogbeat-keystore-windows/268769/1 "2021-03-30T10:18:34Z")

</div>

I have created a keystore for winlogbeats as the administrator and modified winlogbeat.yml

When i try and start the service it fails (running as local system)  
if i run winlogbeat manually it starts

I can see the issue, any suggestions how i go about creating a keystore so that local service can access the keystore?

Thanks

---

<div class="post-metadata">

### Author: ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)
#### Post date: [March 30, 2021, 2:11pm UTC](https://discuss.elastic.co/t/winlogbeat-keystore-windows/268769/2 "2021-03-30T14:11:20Z")

</div>

Hi @probson,

How does Winlogbeat fails? does it report any error?

---

<div class="post-metadata">

### Author: ![probson](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@probson](https://discuss.elastic.co/u/probson)
#### Post date: [March 30, 2021, 2:19pm UTC](https://discuss.elastic.co/t/winlogbeat-keystore-windows/268769/3 "2021-03-30T14:19:28Z")

</div>

Hi @jsoriano

I get the error  
[SC] StartService FAILED 1053:

The service did not respond to the start or control request in a timely fashion.

Also another issue would be that i cannot supply the key in the same command as adding. Trying to create an install script that installs the winlogbeat msi, creates and adds a value to the keystore rather than keeping the key in the .yml

Thanks

---

<div class="post-metadata">

### Author: ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)
#### Post date: [March 30, 2021, 4:21pm UTC](https://discuss.elastic.co/t/winlogbeat-keystore-windows/268769/4 "2021-03-30T16:21:26Z")

</div>

You may be hitting this issue: [[Windows] Beats service fail to start when keystore is used · Issue #12315 · elastic/beats · GitHub](https://github.com/elastic/beats/issues/12315)

Could you try moving the keystore to the data directory?

---

<div class="post-metadata">

### Author: ![probson](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@probson](https://discuss.elastic.co/u/probson)
#### Post date: [March 30, 2021, 4:54pm UTC](https://discuss.elastic.co/t/winlogbeat-keystore-windows/268769/5 "2021-03-30T16:54:06Z")

</div>

thanks that is interesting, i could see a keystore in C:\ProgramData\Elastic\Beats\winlogbeat\data and C:\Program Files\Elastic\Beats\7.12.0\winlogbeat\data both with todays date although program files was a later time

Although despite running

```auto
winlogbeat.exe" -c "C:\ProgramData\Elastic\Beats\winlogbeat\winlogbeat.yml" keystore create -E keystore.path= C:\ProgramData\Elastic\Beats\winlogbeat\data

```

it was the program files that ended up updating

As a test i have copied the keystore from program files and copied to programdata and winlogbeat started.

Do you know if it is possible to supply the keystore add with the password as part of the command?

---

<div class="post-metadata">

### Author: ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)
#### Post date: [March 31, 2021, 10:16am UTC](https://discuss.elastic.co/t/winlogbeat-keystore-windows/268769/6 "2021-03-31T10:16:26Z")

</div>

> [@probson](#):
>
> Do you know if it is possible to supply the keystore add with the password as part of the command?

The `keystore add` subcommand has a `--stdin` flag to provide a value from the standard input, there is an example in the docs: [Secrets keystore for secure settings | Winlogbeat Reference [7.12] | Elastic](https://www.elastic.co/guide/en/beats/winlogbeat/7.12/keystore.html#add-keys-to-keystore).  
Example is for a unix shell, but something similar should also work with powershell.

---

<div class="post-metadata">

### Author: ![probson](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@probson](https://discuss.elastic.co/u/probson)
#### Post date: [March 31, 2021, 11:12am UTC](https://discuss.elastic.co/t/winlogbeat-keystore-windows/268769/7 "2021-03-31T11:12:29Z")

</div>

@jsoriano

Thanks for the help, defined path.data in winlogbeat.yml, it now creates the keystore in the correct place and used the stdin and powershell to add the key and password. Service starting ok.

Thanks  
Phil

---

<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: [April 28, 2021, 1:13pm UTC](https://discuss.elastic.co/t/winlogbeat-keystore-windows/268769/8 "2021-04-28T13:13:23Z")

</div>

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