Protocol |
Action | ||||||||||||||||
|
| ||||||||||||||||
Description |
Execute SQL Expression.
Log into DatabaseLogin. | ||||||||||||||||
|
| ||||||||||||||||
Comments |
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:
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 Events.host = ‘SafeHost'</parameter> <parameter type="FieldName">ev:dbErrs</parameter> <parameter type="DestinationName">Dest.tcpOut</parameter> <parameter type=”DatabaseLogin”> <url>jdbc:mysql://localhost/events</url> <driver>org.gjt.mm.mysql.Driver</driver> <user>username</user> <password>pass</password> </parameter> </destination>
Resulting XML:
<event xmlns:ev="http://www.eventgnosis.com/"> <ev:host>filipov</ev:host> <ev:app>SQL Command</ev:app> <ev:log> jdbc:mysql://localhost/events</ev:log> <ev:dbErrs></ev:dbErrs> <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 event.host = ‘JP'</ev:SQLCommand.CommandString> <ev:SQLCommand.ErrorStatus>-32</ev:SQLCommand.ErrorStatus> </event>