1

I setup a syslogserver with rsyslogd and 3 clients.
Logs from 3 test clients are sent to the server, so far so good.
My Problem is:
I can't get the FQDN hostnames to work.
According to rsyslog.com i have to add "$PreserveFQDN on" in /etc/rsyslog.conf.
I changed this on the server and the 3 clients, restarted rsyslogd and still the short hostname, but if i restart the rsyslogd service on one client it create a log file on the server with its FQDN...

hostname --long gives a good client.example.org result
hostname --short gives client which is fine too.

Any Ideas??
Thanks in advanced!

fips123
  • 361
  • 1
  • 5
  • 17
  • OK found a workaround: Add the Clients to Servers /etc/hosts and changed at server /etc/rsyslog.conf Templatevariable from %HOSTNAME% to %formhost% – fips123 Mar 01 '15 at 18:15

1 Answers1

0

Just in case you keep looking for it, here's the answer.

At rsyslog server, if for example you have defined this template for remote logs, you should use %FROMHOST% variable instead of %HOSTNAME% :

$template RemoteLogs, "/media/largeHDD/logs/%FROMHOST%/%PROGRAMNAME%.log" *
*.*  ?RemoteLogs
& ~
specktator
  • 16
  • 3