Find out more about the enrichment database node that is available in Event Processing.
Database
In situations where the data in the source table might not offer significant insights on its own, establishing connections with external databases and integrating their data can yield a more comprehensive result.
With the database node, you can retrieve data from an external database (PostgreSQL) and integrate the data with the events within your workflow.
Note: Event Processing can be configured to connect to a secure PostgreSQL database. Contact your system administrator if you encounter issues while configuring the database node to communicate with a secure PostgreSQL database.
Adding a database node
To add a database node, complete the following steps.
- Ensure that a stream of events is available, from an Event Source node or from the output of any previously configured node.
- In the Palette, under Enrichment, drag the Database node into the canvas.
-
Connect the node to an event source by dragging the Output Port from a source node into the Input Port of this node. A purple checkbox is displayed on the database node indicating that the node is yet to be configured.
- Hover over the node and click Edit to configure the node.
The Configure database enrichment window appears.
Configuring a database node
To configure a database node, complete the following steps.
- In the Details section, enter a name for your node. The output stream of events from this node will be referred with the name you entered.
-
In the Connect to database, enter the URL of the secured PostgreSQL database.
For example:
jdbc:postgresql://<host>:<port>/<database>?<configuration>
Where:
<host>
is the hostname of the PostgreSQL server.<port>
is the port number of the PostgreSQL server.<database>
is the name of the database that contains the table to be used for enrichment.<configuration>
is the list of configuration parameters for the connection.
- Click Next to open the Access Credentials pane. Enter your username and password (if prompted).
- Click Next. The Table selection pane is displayed.
-
To choose a table from the provided database, you can either search for the table name in the search box, or scroll through the list of all tables in the database. Click the radio button corresponding to the table name that you want to process events from.
Important: Event Processing supports lowercase names for tables and columns in PostgreSQL databases.
-
A preview of the schema of the selected table, along with its associated constraints, is displayed in the Data table preview. Click Next.
Note: In the Data table preview, some data types under the Type column are listed as Not supported. These data types are not supported by Event Processing and the corresponding fields cannot be used to enrich events.
The following data types are supported by Event Processing:
BIGINT
BIGSERIAL
BOOLEAN
CHARACTER
CHARACTER VARYING
DATE
DOUBLE PRECISION
INTEGER
NUMERIC
SMALLINT
SMALLSERIAL
SERIAL
TEXT
VARCHAR
-
In the Match Criteria pane, define your expression by using the property from the source, and the table field.
For example, the incoming event has a field
country_code
with values such as866, 453, 123
and you wish to lookup a human readable name from a database table.The match criteria is used as the join condition between the event and the database table.
event.country_code = database_table.country_code
Note: Ensure the expressions contain an equality condition. Alternatively, you can use the assistant to create an expression. Select Assistant at the right end of the text-box to open the assistant. The assistant offers two separate drop-down lists of properties, for the source table attributes and the database table attributes with constraints, enabling you to construct the expression.
- After you defined an expression, click Next to open the Enrich Properties pane. Include or reject the database table fields for further processing.
-
Click Next to open the Output properties pane, which contains both the input fields from the preceding node, and the previously chosen database table fields. Remove the fields that you do not want to be visible in the output.
Note: To rename properties, hover over a property, and click the Edit icon .
- Scroll down and click Configure to complete the configuration.
A green checkbox appears on the database node if the database node is configured correctly. If there is any error in your configuration, a red checkbox appears.
User actions are saved automatically. For save status updates, see the canvas header.
- Saving indicates that saving is in progress.
- Saved confirms success.
- Failed indicates that there are errors. If an action fails to save automatically, you receive a notification to try the save again. Click Retry to re-attempt the save. When a valid flow is saved, you can proceed to run the job.