I resolved my problem. Beccause Msg from AIX os has some confusion about hostname, you should use %FROMHOST% instead of %HOSTNAME% for $template "dbFormat" :
$template dbFormat,"insert into SystemEvents (Message, Facility,FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%FROMHOST%',%syslogpriority%, '%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%, '%syslogtag%')",sql
-------------------------------------------
/etc/rsyslog.conf:
$template dbFormat,"insert into SystemEvents (Message, Facility,FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%FROMHOST%',%syslogpriority%, '%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%, '%syslogtag%')",sql
# And this finally is a database action
# The semicolon at the end is theoreticaly not necessary,
# but the current rsyslogd has a bug that makes it abort if
# it is missing. As Dennis Olvany pointed out, it would e
# extremely nice to have this semicolon in the sample conf
*.* >localhost,Syslog,root,123456;dbFormat
--------------------------------------------------------------
who has a better solution?
Thanks a lot to Rainer !
HUYNH TRUONG GIANG


