How can syslog-ng be configured to send both the hostname and the IP address. Currently, logs are sent with the IP address of the device/machine, but we want to add the hostname so I could keep my ip management database up to date with the correct hostname (no, I don’t use DHCP :))
If you are sending from one syslog-ng server to another, just add the keep_hostname(yes)
option.
If you are sending from syslog-ng to some other syslog daemon, you need to compile from source and use the enable source spoof option.
If you just want names instead of IPs, then try use_dns(yes)
.
Here’s a short video on configuring syslog-ng.
Check more discussion of this question.