On 11/20/2018 9:37 AM, Mike Schleif wrote:
That is in the original post. There I showed two configurations to the same
database and host - one that has never failed, and the errant one.

So you did.

Old school config. Based on the errors, I assume you're running 8.39. Would recommend using "action" type syntax, as it's much prettier for us poor part-timers.

https://www.rsyslog.com/doc/v8-stable/configuration/modules/ommysql.html

And I quote:

Rsyslog contains a canned default template to write to the MySQL database. It works on the MonitorWare schema. This template is:

$template tpl,"insert into SystemEvents (Message, Facility, FromHost,
Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values
('%msg%', %syslogfacility%, '%HOSTNAME%', %syslogpriority%,
'%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%,
'%syslogtag%')",SQL

Try this in your config:

$template tpltext, "insert into SystemEvents (Message, Facility, FromHost, 
Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values
('%msg%', %syslogfacility%, '%HOSTNAME%', 
%syslogpriority%,'%timereported:::date-mysql%', '%timegenerated:::date-mysql%', 
%iut%,
'%syslogtag%')"
module(load="builtin:omfile" file="/var/log/rsyslog-debug.log" 
template="tpltext")

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to