Can a hostname be added to syslog-ng?
13,696
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.
Related videos on Youtube
Author by
Ed Gl
Updated on September 18, 2022Comments
-
Ed Gl over 1 year
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 :))
-
Ladadadada almost 12 yearsNote that
use_dns(yes)
requires reverse DNS lookups from the central syslog-ng server on the source server's IP address to work. -
Clayton Dukes almost 12 yearsTo add to what Ladadadadada (or something, heh) said, if you have
use_dns
and no dns available, it will use your/etc/hosts
first - assuming you havefiles, dns
set in yournsswitch.conf
. -
Ed Gl almost 12 yearsoptions 1 and 2 is the way to go... thanks!
-
deFreitas almost 6 yearsI need to know where put keep_hostname
-
deFreitas almost 6 yearsok here an example
/etc/syslog-ng/syslog-ng.conf
options {keep_hostname(yes);}; source...
it is really hard to find out when you are a newbie -
Clayton Dukes almost 6 yearsThat's not a good thing to do if you ever start using a more advanced tool like LogZilla. Instead, put that ip in a metatag with the message, like host_ip="10.72.13.130" $MSG