# Metricbeat MSSQL - Secure pwd keystore not working

**URL:** https://discuss.elastic.co/t/metricbeat-mssql-secure-pwd-keystore-not-working/375096
**Category:** Beats
**Tags:** metricbeat
**Created:** [February 26, 2025, 2:03pm UTC](https://discuss.elastic.co/t/metricbeat-mssql-secure-pwd-keystore-not-working/375096 "2025-02-26T14:03:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![giomlux](https://avatars.discourse-cdn.com/v4/letter/g/90ced4/32.png) [@giomlux](https://discuss.elastic.co/u/giomlux)
#### Post date: [February 26, 2025, 2:03pm UTC](https://discuss.elastic.co/t/metricbeat-mssql-secure-pwd-keystore-not-working/375096/1 "2025-02-26T14:03:00Z")

</div>

Hi Everyone,  
I would like to connect the Metricbeat MSSQL using a secure password into a keystore.  
I have created a keystore, define the password into mssql.yml as described below:

metricbeat keystore create  
metricbeat keystore add MB\_PWD \>\> set the password

> > mssql.yml:

```auto
> - module: mssql
> metricsets:
> - "transaction_log"
> - "performance"
> hosts: ["sqlserver://MYSQLXSERVER/SQLINST:1439"]
> username: metricB
> password : "${MB_PWD}"
> period: 10s

```

the error received into the metricBeat log file is:

`{"file.name":"instance/beat.go","file.line":1307},"message":"Exiting: 2 errors: host parsing failed for mssql-transaction_log: missing field accessing '0.password' (source:'C:\\Program Files\\metricbeat\\modules.d\\mssql.yml'); host parsing failed for mssql-performance: missing field accessing '0.password' (source:'C:\\Program Files\\metricbeat\\modules.d\\mssql.yml')","service.name":"metricbeat","ecs.version":"1.6.0"}`

It Works When i use the same password in CLEAR into the mssql.yml file

Could you please help me with that one?

Thank you.  
Regards,  
giomlux
