destination loghost { tcp("192.168.0.252" port(5140)); }; log { source(src); destination(loghost); };Short documentation:
create_dirs(yes);It allows syslog-ng to create subdirs for each connecting host, sorting logfiles.
source remote_src { tcp(ip("192.168.0.252") port(5140)); };This creates the source remote_src(can be named anything). It reads syslog-ng entries from the given ip-interface (the IP address is the one on the server, and it also defines the port it listens to
destination remote_messages { file("/home/HOSTS/$HOST/messages"); };Now, we redirect all those incoming log-entries to this log-path. The $HOST variable is the IP of the connecting server, so this (in joint effort with the create_dirs(yes)) creates the structure "/home/HOSTS/192.168.0.99/messages" and so on.
log { source(remote_src); destination(remote_messages); };Finally, tell syslog-ng to take all incoming log entries from remote_src and send them to destination remote_messages