0
votes

From a client machine running syslog-ng I want to send multiple log files to remote syslog-ng server. Is there any macro that can tell me the source file name so that on remote server I can separate out the logs and put it to separate log files.

Or if not by filename is there any other way I can separate log messages. Basically there should be 1-1 mapping. Logs of file a.log to go to x.log on remote server, b.log -> y.log

1
you might have better luck with such a question on unix.stackexchange.comTommy

1 Answers

0
votes

Could solve it with below config - Client side configuration in syslog-ng -

file("/var/log/shell.log" log_prefix("shell: "));

Server side configuraion in syslog-ng - filter f_shell { match("shell" value("MSGHDR")); }; destination d_shell { file("/var/log/syslog-ng/shell.log"); }; log { source(demo_tls_src); filter(f_shell); destination(d_shell); flags(final); };