# Metricbeat service starts then stop when trying to use the MSSQL

**URL:** <https://discuss.elastic.co/t/metricbeat-service-starts-then-stop-when-trying-to-use-the-mssql/240545>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [July 9, 2020, 3:10pm UTC](https://discuss.elastic.co/t/metricbeat-service-starts-then-stop-when-trying-to-use-the-mssql/240545 "2020-07-09T15:10:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhaycraft](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jhaycraft](https://discuss.elastic.co/u/jhaycraft)\
**Post date:** [July 9, 2020, 3:10pm UTC](https://discuss.elastic.co/t/metricbeat-service-starts-then-stop-when-trying-to-use-the-mssql/240545/1 "2020-07-09T15:10:43Z")

</div>

I'm trying to log some metrics from Microsoft MSSQL and the Metricbeat service starts then stop. I'm thinking that I have something wrong in the mssql.yaml file that is causing this. Windows errors logs have not been much help. Has anyone seen this before? ![local mssql info](https://us1.discourse-cdn.com/elastic/original/3X/1/6/16bfa30f3c4dd0ce0279741653696f3c5a28c82c.png)

 ![7_9_2020_error](https://us1.discourse-cdn.com/elastic/original/3X/9/0/90c96351e000be8c00b70a93ba3d8fa1bd02bada.png)

---

<div class="post-metadata">

**Author:** ![jhaycraft](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jhaycraft](https://discuss.elastic.co/u/jhaycraft)\
**Post date:** [July 9, 2020, 3:12pm UTC](https://discuss.elastic.co/t/metricbeat-service-starts-then-stop-when-trying-to-use-the-mssql/240545/2 "2020-07-09T15:12:29Z")

</div>

yaml file looks like this:

# Module: mssql

# Docs: [https://www.elastic.co/guide/en/beats/metricbeat/7.8/metricbeat-module-mssql.html](https://www.elastic.co/guide/en/beats/metricbeat/7.8/metricbeat-module-mssql.html)

- module: mssql  
metricsets:
  - "transaction\_log"
  - "performance"  
hosts: ["TSFARM-DATA\SQL2016"]  
username: sa  
password: verysecurepassword  
period: 10s

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [July 13, 2020, 7:30am UTC](https://discuss.elastic.co/t/metricbeat-service-starts-then-stop-when-trying-to-use-the-mssql/240545/3 "2020-07-13T07:30:23Z")

</div>

Hi!

The indentation in the configuration you posted is wrong? Could you verify that the failure you see is not because of this?

Also I would suggest tuning the logging settings ([https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-logging.html](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-logging.html)) and look into the logs for the specific error.

C.

---

<div class="post-metadata">

**Author:** ![jhaycraft](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jhaycraft](https://discuss.elastic.co/u/jhaycraft)\
**Post date:** [July 14, 2020, 2:20pm UTC](https://discuss.elastic.co/t/metricbeat-service-starts-then-stop-when-trying-to-use-the-mssql/240545/4 "2020-07-14T14:20:34Z")

</div>

I was able to get the service started now. Thank you for that. However I still don't seem to be getting SQL metrics. Any idea?

---

<div class="post-metadata">

**Author:** ![jhaycraft](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jhaycraft](https://discuss.elastic.co/u/jhaycraft)\
**Post date:** [July 14, 2020, 8:50pm UTC](https://discuss.elastic.co/t/metricbeat-service-starts-then-stop-when-trying-to-use-the-mssql/240545/5 "2020-07-14T20:50:41Z")

</div>

here is the yaml after correction:

# Module: mssql

# Docs: [https://www.elastic.co/guide/en/beats/metricbeat/7.8/metricbeat-module-mssql.html](https://www.elastic.co/guide/en/beats/metricbeat/7.8/metricbeat-module-mssql.html)

? "-module"  
: mssql  
? "hosts:TSFARM-DATA\SQL2016"  
: ~  
metricsets: ~  
? "password:"  
: ~  
performance: ~  
period: 10s  
tansaction\_log: ~  
? "username:sa"  
: ~

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [July 15, 2020, 7:43am UTC](https://discuss.elastic.co/t/metricbeat-service-starts-then-stop-when-trying-to-use-the-mssql/240545/6 "2020-07-15T07:43:53Z")

</div>

Hi!

I suggest you should check in the logs for errors since may things can go wrong. Run Metribceat in debug mode and check if there is any related error.

You can find more about logging at [https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-logging.html](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-logging.html)

---

<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:** [August 12, 2020, 9:43am UTC](https://discuss.elastic.co/t/metricbeat-service-starts-then-stop-when-trying-to-use-the-mssql/240545/7 "2020-08-12T09:43:57Z")

</div>

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