# Logstash connecting to more than 1 Database

**URL:** <https://discuss.elastic.co/t/logstash-connecting-to-more-than-1-database/341791>\
**Category:** Logstash\
**Tags:** jdbc\
**Created:** [August 28, 2023, 8:52am UTC](https://discuss.elastic.co/t/logstash-connecting-to-more-than-1-database/341791 "2023-08-28T08:52:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ong/32/40766_2.png) [@Ong](https://discuss.elastic.co/u/Ong)\
**Post date:** [August 28, 2023, 8:52am UTC](https://discuss.elastic.co/t/logstash-connecting-to-more-than-1-database/341791/1 "2023-08-28T08:52:07Z")

</div>

I have 2 separate MSSQL databases and would like to extract data from them, combine it and send it to ES for indexing.

Can Logstash connect to more than 1 MSSQL database, retrieve certain data from them then combine the retrieved datasets into 1 document and send it to ES for indexing?

Thank you

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 28, 2023, 1:10pm UTC](https://discuss.elastic.co/t/logstash-connecting-to-more-than-1-database/341791/2 "2023-08-28T13:10:00Z")

</div>

logstash can certainly connect to more than one database. It is possible you would want to use an [aggregate](https://www.elastic.co/guide/en/logstash/current/plugins-filters-aggregate.html) filter to combine events, or perhaps use data from one database to enrich documents from the other using either a jdbc\_streaming or jdbc\_static filter.

---

<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:** [September 25, 2023, 1:10pm UTC](https://discuss.elastic.co/t/logstash-connecting-to-more-than-1-database/341791/3 "2023-09-25T13:10:15Z")

</div>

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