I have some error using the ommysql to record my syslog message to a DB.
It actually work fine, but I some how I have a INSERT who go with the wrong table name, and I didn't find this call inside any syslog plugin function.
this is the error:
Code: Select all
Nov 30 09:19:00 lslcacp02 rsyslogd: ommysql: db error (1146): Table 'syslog.SystemEvents' doesn't exist [v8.2208.0]
Nov 30 09:19:00 lslcacp02 rsyslogd: The error statement was: insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values (' The error statement was: insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values (\' The error statement was: insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values (\\\' (to root) a_soi_0454 on pts/2\\\', 4, \\\'lslcacp02\\\', 5, \\\'20231130091900\\\', \\\'20231130091900\\\', 1, \\\'su:\\\') [v8.2208.0 try https://www.rsyslog.com/e/2218 ]\', 5, \'lslcacp02\', 3, \'20231130091900\', \'20231130091900\', 1, \'rsyslogd:\') [v8.2208.0 try https://www.rsyslog.com/e/2218 ]', 5, 'lslcacp02', 3, '20231130091900', '20231130091900', 1, 'rsyslogd:') [v8.2208.0 try https://www.rsyslog.com/e/2218 ]
Nov 30 09:19:00 lslcacp02 rsyslogd: action 'action-0-ommysql' (module 'ommysql') message lost, could not be processed. Check for additional error messages before this one. [v8.2208.0 try https://www.rsyslog.com/e/2218 ]
here is my settings for rsyslog daemon:
Code: Select all
module(load="ommysql")
action(type="ommysql" server="server" serverport="3306"
db="database" uid="username" pwd="password")
$template cacti_syslog,"INSERT INTO syslog_incoming(facility_id, priority_id, program, logtime, host, message) \
values (%syslogfacility%, %syslogpriority%, '%programname%', '%timegenerated:::date-mysql%', '%HOSTNAME%', TRIM('%msg%'))", SQL
local7.* >server,database,username,password;cacti_syslog