Database Command Destination







Execute SQL Expression. Log into DatabaseLogin.
Create a new event from the results of the SQL command execution, setting FieldName to the returned result, FieldName to its error output, sending the new event to DestinationName




The SQL command is triggered by the arrival of an event so that it can write events into a database table depending on the specified SQL expression.

If Expression or DatabaseLogin is missing, blank or invalid the writer will be disabled.

If DestinationName is missing, blank or invalid a new event will not be sent.

If DestinationName exists, an event will be created and sent to it.

In addition to custom set output and error fields, event will also have following fields:

Event Field Contents
ev:host hostname
ev:app command being executed
ev:log "SQL Command"
ev:SQLCommand.StartTime command execution start time
ev:SQLCommand.EndTime command execution end time
ev:SQLCommand.ExecutionSecs command execution time in seconds
ev:SQLCommand.CommandString SQL Command String


Special XML characters are translated according to the XML Character Translation Table.



<destination objectId="DbCmdSource" type="DatabaseWriter" stdout="FS.DemoAlive">
	<parameter type="Command">select * from Events where = ‘SafeHost'</parameter>
	<parameter type="FieldName">ev:dbErrs</parameter>
	<parameter type="DestinationName">Dest.tcpOut</parameter>
	<parameter type=”DatabaseLogin”>


Event Mapping

Resulting XML:

<event xmlns:ev="">
	<ev:app>SQL Command</ev:app>
	<ev:log> jdbc:mysql://localhost/events</ev:log>
	<ev:SQLCommand.StartTime> Feb 25 2003 12:34:56 </ev:SQLCommand.StartTime>
	<ev: SQLCommand.EndTime> Feb 20, 2003 13:45:53 </ev:SQLCommand.EndTime>
	<ev: SQLCommand.ExecutionSecs>13</ev:SQLCommand.ExecutionSecs>
	<ev:SQLCommand.CommandString>select * from hostJZ where = ‘JP'</ev:SQLCommand.CommandString>