I am using trigger to do this.
Go to log path
root@sta-tn:/etc/rsyslog.d#
then write a sub-rsyslog configuration.
root@sta-tn:/etc/rsyslog.d# vim 10-sta.conf
if $programname == 'STA' then {
/var/log/sta.log
stop
}
You can declare more directive here. Then restart rsyslog service
root@sta-tn:/etc/rsyslog.d# systemctl restart rsyslog
Another way, you can use imfile module to do this.
Tiến Phan - R0039 Knowledge is Endless Sharing for Success
0 nhận xét:
Post a Comment