%hostname% is the name that the sender puts in the log message. If the sender sends a malformed message that has this missing (and rsyslog is able to detect that it's missing), rsyslog puts in the reverse DNS name of the machine it received the log from, if there is no reverse DNS entry, it puts in the IP address.

Right now there is not a reasonable way to do this in rsyslog.

David Lang

On Wed, 26 Jun 2013, jc_ruiz wrote:

I have a working template that I use to create my dynamic files and it is
working great and very happy with the automation of it.$template
FilePerHost,"/var/log/syslog/system-%HOSTNAME%/%timegenerated:1:10:date-rfc3339%.log"My
issue is that I have about 5000 plus network devices and some have pointer
records and some do not so the folder system-%HOSTNAME% sometimes is an IP
address and sometimes it is a hostname. What can I do on rsyslog to replace
%HOSTNAME% in the template I use for the hostname value in the syslog
message of the sending network deviceIn the message below *r-labl-r1* is the
hostname? I don?t want to create pointer records for some many devices
instead I rather use rsyslog to do the work .Jun 26 11:35:11 10.20.2.65
107526: r-lab-r1: Jun 26 15:35:11: %SEC-6-IPACCESSLOGP: list ACCESS-ACL
denied udp 10.59.50.177(138) (Thanks in advance for all that looked and
replied. Regards,jc



--
View this message in context: 
http://rsyslog-rsyslog-users.1305293.n2.nabble.com/replace-value-in-template-to-enhance-dynamic-file-name-tp7581019.html
Sent from the rsyslog -- rsyslog-users mailing list archive at Nabble.com.
_______________________________________________
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.
_______________________________________________
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