Solving Incorrect hostname!

This is the place for you, if you got rsyslog up and running but wonder how to make it do what you want.

Moderator: rgerhards

Solving Incorrect hostname!

Postby gianght on Sat Dec 02, 2006 3:49 am

Incorrect Hostname !

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
gianght
New
 
Posts: 4
Joined: Fri Dec 01, 2006 8:43 am

RE: Solving Incorrect hostname!

Postby rgerhards on Mon Dec 04, 2006 8:45 am

Hi, after what I have seen from the AIX format, this solution currently seems to be the best. Eventually, I would implement some AIX specific parsing, but only if there is more desire to have this.

Rainer
User avatar
rgerhards
Site Admin
 
Posts: 1067
Joined: Thu Feb 13, 2003 11:57 am

Google Ads



Return to Configuration

Who is online

Users browsing this forum: No registered users and 0 guests

cron