amane Respected Contributor.
Respected Contributor.
195 views

Adding two databases in one connector

Hello All,

Good Day.

I am trying to develop a ID-BASED DB flex connector, that will fetch the data from MS SQL Server.

However, in our case, we have two databases in SQL Server. As per my understanding, we can use only on database per DSN.

Is there any way to fetch info from two or more database?

Below is the overview of question:

Input:

1. Two databases e.g ABC and XYZ having multiple tables.

Output:

1. Should generate a single line output from both database. e.g. By using INNER JOIN etc.

Looking forward for your help.

Regards,

Ameer Mane

Labels (2)
0 Likes
2 Replies
pbrettle Acclaimed Contributor.
Acclaimed Contributor.

Re: Adding two databases in one connector

Unfortunately you are correct, one connection only I am afraid.

That said, you could look at options here. Maybe chain a couple of connectors together? So one connector reads the first database but outputs the data into a CEF file. Then have the other connector read the second database and do the same - so you end up with two files with CEF data in them - use a python script to merge the two files together and then use a third and final connector to read the merged file for processing.

From there you can do what is called an event merge, where you look at multiple events and join them into a single one. Of course this totally depends on what data you want to merge together, but it could be possible to address it this way and make sure you get the concatenated data processed correctly.

For event merge functionality, see the following:

https://www.protect724.hpe.com/message/34301#comment-34301

There is a PDF posted that covers what it does and an example listed.

Or you can run an external python script to do the join query, export to a CEF file and do it from there - but I like the idea of a connector doing it as you have a lot more control over how it runs, when it runs and what you do with the data (as in formatted etc). Your call though.

0 Likes
Acclaimed Contributor.. balahasan.v1 Acclaimed Contributor..
Acclaimed Contributor..

Re: Adding two databases in one connector

Hi Ameer,

Have u tried the Multiple db flex connector and test it. As it is not easy to built a join on the developing a flex.

The Multi-Database FlexConnector reads events from more than one database or multiple event types from different tables in the same database.

So My Recommendation is for you to create a merged data view on the database itself and install a db flex to read from the view which u have created.

Please let me know if that suits your requirement.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.