This feature is available only in the licensed version.
You can add an action to log a syslog message to an ODBC database. By default, the Log to Database action logs the following message field values:
If you want to log different values, you can:
Create a custom database format. The custom format will be available for selection when you create a Log to Database action.
Use the Run script action to parse the syslog message, assign values to custom fields, and log them to a database.
Use the scripting function ActionLogToODBC to send SQL statements and raw data to a database connection.
Create a database, or select an existing database that Kiwi Syslog Server can write to.
If the database file is opened exclusively by another process, Kiwi Syslog Server might not be able to write new records to the database.
Some example ODBC databases are available for download from the SolarWinds Success Center. The ZIP file contains information and sample databases that you can use as a guide to help you set up ODBC logging on your own system.
Determine how you want to create the table that stores message values. The following options are available:
|Automated option||When you add the action, click Create table. Kiwi Syslog Server creates a table containing the required columns.|
|Semi-automated option||When you add the action, click Show SQL commands. The SQL commands used to create the table are shown in a text editor. You can run these commands in your database application.|
|Manual option||If you choose to create the table manually before you add the action, use the table design for the selected database type. Be sure that the name, data type, and size of each column match the table design. If the sizes are too small, the data could be truncated when it is written to the database.|
From the Action menu, select Log to Database.
Specify the following options.
|Data link connection string|| |
|Database Table name|| |
Enter the name of the database table where message values are logged. You can either:
|Database type/field format|
|Connection Inactivity timeout|| |
Specify how long the database connection is kept open after the last message has been sent. Because opening and closing the connection can be the slowest part of logging to a database, the connection is kept open while data is actively being logged. If no more messages have been logged before the timeout value expires, the database connection is closed. As soon as a new message arrives, the connection is reopened.
The default for this setting is 600 seconds (10 minutes). A value of 0 ensures that the connection will never time out. The maximum value is 86400 seconds (1 day).
|Run debug command|| |
If there is a problem logging to the database, click this button and enter a SQL command to be executed on the database. If the command fails, the results field displays a detailed error message. By default, the current INSERT statement used for the selected database type is displayed in the query field. This statement can be modified to test particular variations of the statement.
|Database cleanup|| |
Select this option to clean up the database by deleting older messages.
The cleanup operation is performed nightly. Click Cleanup now to perform the operation immediately.
When you test logging messages from the Service Manager, the program runs as the current user (probably "Administrator"). When Kiwi Syslog Server actually logs messages to a database, the service runs as the "Local System" user by default.
If your test messages work but the messages are not being logged, try changing the service login ID to "Administrator" instead of "Local System." Use the Services applet under Control Panel. Also consider selecting the option that allows the program to interact with the desktop.