# Metricbeat MSSQL - keystore

**URL:** https://discuss.elastic.co/t/metricbeat-mssql-keystore/222933
**Category:** Beats
**Tags:** metricbeat
**Created:** [March 10, 2020, 12:42pm UTC](https://discuss.elastic.co/t/metricbeat-mssql-keystore/222933 "2020-03-10T12:42:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![shortcommand](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@shortcommand](https://discuss.elastic.co/u/shortcommand)
#### Post date: [March 10, 2020, 12:42pm UTC](https://discuss.elastic.co/t/metricbeat-mssql-keystore/222933/1 "2020-03-10T12:42:15Z")

</div>

Hi,

I've a problem with using keystore to store passwords for DB connection in the MSSQL module.  
I've created a keystore and and added a key called SA\_PW. I can see this key in the keystore when I list all keys in the keystore.

This is my MSSQL module config:

```
- module: mssql
  metricsets:
    - "transaction_log"
    - "performance"
  hosts: ["MyMachine"]
  username: sa
  password: "${SA_PW}"
  period: 10s

```

If if use the password in plaintext it works.  
Error message from log:

```
|2020-03-10T13:38:40.496+0100|INFO|instance/beat.go:445|metricbeat stopped.
|2020-03-10T13:38:40.501+0100|ERROR|instance/beat.go:933|Exiting: 2 errors: host parsing failed for mssql-transaction_log: missing field accessing '0.password' (source:'C:\metricbeat-7.6.0-windows-x86_64\modules.d\mssql.yml');|

```

Am I doing something wrong here?

Thanks in advance.

---

<div class="post-metadata">

### Author: ![cosruss](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@cosruss](https://discuss.elastic.co/u/cosruss)
#### Post date: [April 6, 2020, 6:52pm UTC](https://discuss.elastic.co/t/metricbeat-mssql-keystore/222933/2 "2020-04-06T18:52:14Z")

</div>

I just had this problem. Make sure that you set the data\_path when you create the keystore to the same data\_path you use when running Metricbeat. That was my problem.

---

<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: [May 4, 2020, 6:52pm UTC](https://discuss.elastic.co/t/metricbeat-mssql-keystore/222933/3 "2020-05-04T18:52:17Z")

</div>

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