Add an action to log messages to a database in KSS NG
You can add an action to log messages to a database using a bulk insert. You can use a bulk insert to log multiple events in a single connection to the database, rather than establishing and closing a session for each event.
- From the KSS NG navigation bar, choose Setup > Rules.
- Locate an existing rule. If the rule does not exist, add a rule and start the New Rule wizard.
- If you are adding an action to an existing rule, select the rule and click Edit. If you are creating a new rule, navigate to the Actions step of the New Rule wizard.
- Click Add Action. Define the action name in the provided field.
-
In the Action drop down, select Log to database - new bulk insert.
-
Select the database type and enter the connection string. See example connection strings below.
MSSQL Data Source=127.0.0.1;User Id=KiwiUser;Password=***;Initial Catalog=kssNGPostgreSQL Host=127.0.0.1;Database=ng1;Username=kiwiuser;Password=***;OracleSQL (EZCONNECT) User Id=system;Password=***;Data Source=127.0.0.1:1521/orcl;OracleSQL (Full descriptor) User Id=system;Password=***;
Data Source=(DESCRIPTION=
(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
(CONNECT_DATA=(SERVICE_NAME=orcl))
);MongoDB mongodb://kiwiuser:***@127.0.0.1:27017/kiwi?authSource=adminMySQL Server=127.0.0.1;Port=3306;Database=ng1;User ID=KiwiUser;Password=***;AllowLoadLocalInfile=true; -
Enter the database table name. Click Create new... to generate the database.
- (Optional) Click Advanced Options to specify the number of maximum records, maximum milliseconds, and connection inactivity timeout, if desired.
- Click Test to verify that records log to the database in bulk correctly.
- If you are adding an action to an existing rule, click Apply. If you are creating an action in the New Rule wizard, click Add.