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;Elasticsearch (via Endpoint) {
"url": "https://10.218.209.117:9200",
"username": "kssng",
"password": "testAutotest123",
"caThumbprint": "956a567f776aab4b3eeb4bc07beb097c73489261"
}Elasticsearch (via CloudID) {
"cloudId": "My_deployment:ZXUtY2VudHJhbC0xLmF3cy5jbG91ZC5lGy5pbyRlZWQ1MDE2Y6RlZTE0OTZlODRmMDBjMjM4Y2E4YmJiMyRkNzM0NDk5MTMzODY0MzNiYWE3NTg2NTY5YzhmY2Q5OQ==",
"apiKey": "c1hkRmtaMEsDUnpJaVpkMU8yclQ6bzhFc2R1UX66dFF6dlFiGFpNWWJYUQ==",
"index": "TableName"
} -
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.