I am using syslog-ng
on Ubuntu 12.4 server.
I have few Mikrotik routers . In syslog-ng
I have managed to add single host for logging. It's being Configured as below :
# Accept connection on UDP
source s_net { udp (); };
# MIKROTIK ###########
# Add Filter to add our mikroti
filter f_mikrotik { host( "192.168.100.2" ); };
# Add destination file where logs will be stored
#destination df_mikrotik { file("/var/log/mikrotik.log"); };
log { source ( s_net ); filter( f_mikrotik ); destination ( df_mikrotik ); };
destination df_mikrotik {
file("/var/log/mikrotik/mikrotik.${YEAR}.${MONTH}.${DAY}.log"
# template("${HOUR}:${MIN}:${SEC} ${HOST} ${MSG} ${MSG}\n")
template-escape(no));
};
...It's working fine & creates file /var/log/mikrotik/mikrotik.${YEAR}.${MONTH}.${DAY}.log
But now I want to add more IP's of Mikrotik in it for centralized logging system with each host file separately.
How can I add multiple entries so every host have its own log file?