Yum install –y syslog-ng

配置文件

/etc/syslog-ng/syslog-ng.conf

@version:3.5
@include "scl.conf"
options {
    flush_lines (0);
    time_reopen (10);
    log_fifo_size (1000);
    chain_hostnames (off);
    use_dns (no);
    use_fqdn (no);
    create_dirs (yes);
    keep_hostname (yes);
};
@include "/etc/syslog-ng/conf.d/*.conf"

子配置文件

@version: 3.5
source log5555 {
    syslog(ip(0.0.0.0) port(5555));
};
destination log5555 { 
    file("/var/log/syslog-ng/$PROGRAM/${S_MONTH}${S_DAY}/${HOST}.${SOURCEIP}.log"); 
};
log{
    source(log5555);destination(log5555);
};
Copyright © opschina.org 2017 with zzlyzq@gmail.com all right reserved,powered by Gitbook该文件修订时间: 2017-07-11 11:32:48

results matching ""

    No results matching ""