# How to configure multiple sql instance in windows/metricbeat.yml

**URL:** <https://discuss.elastic.co/t/how-to-configure-multiple-sql-instance-in-windows-metricbeat-yml/161978>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [December 24, 2018, 7:14am UTC](https://discuss.elastic.co/t/how-to-configure-multiple-sql-instance-in-windows-metricbeat-yml/161978 "2018-12-24T07:14:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akila](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@Akila](https://discuss.elastic.co/u/Akila)\
**Post date:** [December 24, 2018, 7:14am UTC](https://discuss.elastic.co/t/how-to-configure-multiple-sql-instance-in-windows-metricbeat-yml/161978/1 "2018-12-24T07:14:14Z")

</div>

We have installed metricbeat in windows and configured perfmon entry in windows.yml file to capture SQL instance ( MSSQL ) counters for single instance.  
In windows.yml file we hot-coded instance name under "instance\_name" and "query" fields(pls refer below sample entries)

module : windows  
metricsets:  
-perfmon  
period:10s  
perfmon.counters:  
-instance\_label: mssql.bufferManager.name  
instance\_name:SERVERNAME\SQLINSTANCEName1  
measurement\_label:mssql.bufferManager.bufferCacheHitRatio  
query: '\MSSQL$SQLINSTANCEName1:Buffer Namager\Buffer Cache hit ratio'

-instance\_label: mssql.accessMethods.name  
instance\_name:SERVERNAME\SQLINSTANCEName1  
measurement\_label:mssql.accessMethods..indexSearchSec  
query: '\MSSQL$SQLINSTANCEName1:Access Methods\Index Searches/sec'

In metricbeat.yml file also, we hot-coded instance name under "fields" column ,(pls refer below sample entries )  
fields:  
type:Database  
technology:MSSQL  
instanceName: SERVERNAME\SQLINSTANCEName1

Multiple sql instance's are running in our server (includes both default as well as named instances), to configure for multiple instances, then I should duplicate all the metricsets again for new instances in windows.yml and configure new instance name in metricbeat.yml ..

Is there any other way to capture perfmon for all sql instances which are running in the server ?  
I searched in net, but didnt get any solution. Can any one please help on this ?

---

<div class="post-metadata">

**Author:** ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)\
**Post date:** [January 3, 2019, 3:15pm UTC](https://discuss.elastic.co/t/how-to-configure-multiple-sql-instance-in-windows-metricbeat-yml/161978/2 "2019-01-03T15:15:20Z")

</div>

@andrewkroh Do you know the answer here? Thank you in advance!

---

<div class="post-metadata">

**Author:** ![maddin2016](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maddin2016/32/16599_2.png) [@maddin2016](https://discuss.elastic.co/u/maddin2016)\
**Post date:** [January 3, 2019, 6:26pm UTC](https://discuss.elastic.co/t/how-to-configure-multiple-sql-instance-in-windows-metricbeat-yml/161978/3 "2019-01-03T18:26:45Z")

</div>

In your case this is not possible because you only can use wildcards for `(parent/instance)/counter` but not for the object `\MSSQL$SQLINSTANCEName1:Access Methods`. For example this would work `\Access Methods(SQLINSTANCE1)\Index Searches/sec`. Then you where able to put an `*` for the instance.

---

<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:** [January 31, 2019, 6:26pm UTC](https://discuss.elastic.co/t/how-to-configure-multiple-sql-instance-in-windows-metricbeat-yml/161978/4 "2019-01-31T18:26:50Z")

</div>

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