# Required Privilege in Microsoft SQL Server to Connect With Elastic Integration and Logstash JDBC Plugin

**URL:** <https://discuss.elastic.co/t/required-privilege-in-microsoft-sql-server-to-connect-with-elastic-integration-and-logstash-jdbc-plugin/324510>\
**Category:** Logstash\
**Tags:** jdbc\
**Created:** [February 2, 2023, 8:03am UTC](https://discuss.elastic.co/t/required-privilege-in-microsoft-sql-server-to-connect-with-elastic-integration-and-logstash-jdbc-plugin/324510 "2023-02-02T08:03:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![OmFJ](https://avatars.discourse-cdn.com/v4/letter/o/8e7dd6/32.png) [@OmFJ](https://discuss.elastic.co/u/OmFJ)\
**Post date:** [February 2, 2023, 8:03am UTC](https://discuss.elastic.co/t/required-privilege-in-microsoft-sql-server-to-connect-with-elastic-integration-and-logstash-jdbc-plugin/324510/1 "2023-02-02T08:03:31Z")

</div>

Hi Everyone, i would like to ask related with Microsoft SQL Integration and JDBC Plugin in logstash. as we know we need username and password to access the database with JDBC or Microsoft SQL Integration. my question would be, what privilege does the account require to access the information within the database? i have little to no experience about privilege in SQL or DB, so bear with me.

Or is there any another forum post or discussion regarding this topic?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [February 3, 2023, 9:41pm UTC](https://discuss.elastic.co/t/required-privilege-in-microsoft-sql-server-to-connect-with-elastic-integration-and-logstash-jdbc-plugin/324510/2 "2023-02-03T21:41:05Z")

</div>

First prepare working query, then user, then test is everything working fine. You should create a login, mapped to user, assigned to database, grant select permission on those tables which will use. You will find plenty tutorials for this.  
Latter you will add all that in the input JDBC plugin which is the domain of this topic.

---

<div class="post-metadata">

**Author:** ![OmFJ](https://avatars.discourse-cdn.com/v4/letter/o/8e7dd6/32.png) [@OmFJ](https://discuss.elastic.co/u/OmFJ)\
**Post date:** [February 6, 2023, 7:13am UTC](https://discuss.elastic.co/t/required-privilege-in-microsoft-sql-server-to-connect-with-elastic-integration-and-logstash-jdbc-plugin/324510/3 "2023-02-06T07:13:16Z")

</div>

Thank you for the reply and suggestions.  
Yes, i already prepared the queries, the user, and access to the DB table. it's working fine now.

for Microsoft SQL Integration for Elastic Agent, the privileges are listed in metricbeat documentation.

> **[MSSQL module | Metricbeat Reference \[8.6\] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-mssql.html)**

i forgot to check each module 😅

---

<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:** [March 6, 2023, 7:13am UTC](https://discuss.elastic.co/t/required-privilege-in-microsoft-sql-server-to-connect-with-elastic-integration-and-logstash-jdbc-plugin/324510/4 "2023-03-06T07:13:40Z")

</div>

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