I am trying to get several Cisco swtches to log remotely to rsyslog. The logging works fine but rsyslog insists the hostname is the source IP address. I had the network guy set the device-id to the name of the switch but rsyslogs still thinks HOSTNAME is the IP address.

The specific configuration is:

template (name="NwDevLog" type="string" string="/var/log/network/%HOSTNAME%/messages.log")

if $syslogfacility-text == 'local5' then ?NwDevLog
if $syslogfacility-text == 'local5' then stop

I finally "fixed" it by adding the IP and host name to /etc/hosts on the syslogger but that seem like a workaround.

Where does rsyslog get the hostname from?

--
Do not become so fixated on the cheese at the end of the maze that you forget the real goal is to escape from the lab.

Stephen
_______________________________________________
rsyslog mailing list
https://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