In syslog-ng.conf I have the following:
source s_imp { tcp(ip("localhost") port(514)); };
filter f_imp {program("imp");};
destination d_imp {file("/home/rpr/syslog.log");};
log {source(s_imp); filter(f_imp); destination(d_imp);};The output that I get in syslog.log is:
Apr 8 05:11:20 127.0.0.1 imp[4463]: messageI'd like to log only the message and not the time stamp, IP address etc. Is there a way to do this?
1 Answer
This can be done with the help of templates. $MSG has the message contents and we can ensure that only it is logged.
template t_imp { template("$MSG\n"); template_escape(no);
};
destination d_imp { file("/home/rpr/syslog.log" template(t_imp));
};