@version: 3.32

# This is a custom syslog-ng configuration file, based in
# https://github.com/syslog-ng/syslog-ng/blob/master/packaging/debian/syslog-ng.conf
#

# First, set some global options.
options {
    chain_hostnames(off);
    flush_lines(0);
    use_dns(no);
    use_fqdn(no);
    owner("root");
    group("root");
    perm(0644);
    stats_freq(0);
    bad_hostname("^gconfd$");
    ts-format("iso");
    time_zone("UTC");
    mark-freq(0);
    frac-digits(3);
    keep-hostname(yes);
};

# common block end


source s_src {
    system();
    internal();
    syslog(ip(19.88.4.17) transport("udp") port(514) keep-alive(no));
};

rewrite r_host { set("MY-${HOST}", value("HOST")); };

# localFile: kernel
destination d_localfile_kernel {
    program("/usr/local/bin/write_with_rotation.sh /var/log/kernel.log 10 10"
        flags(syslog-protocol)
        suppress(5)
        disk-buffer(
            mem-buf-size(2097152)
            disk-buf-size(4194304)
            reliable(yes)
            dir("/tmp")
        )
    );
};
filter f_localfile_kernel_kern {
    facility(kern) and level(info .. emerg);
};
filter f_localfile_kernel {
    filter(f_localfile_kernel_kern); };
log {
    source(s_src);
    filter(f_localfile_kernel);
    destination(d_localfile_kernel);
    flags(flow-control);
};
# end of localFile: kernel

# localFile: messages
destination d_localfile_messages {
    program("/usr/local/bin/write_with_rotation.sh /var/log/messages.log 10 10"
        flags(syslog-protocol)
        suppress(5)
        disk-buffer(
            mem-buf-size(2097152)
            disk-buf-size(4194304)
            reliable(yes)
            dir("/tmp")
        )
    );
};
filter f_localfile_messages_mail {
    facility(mail) and level(info .. emerg);
};
filter f_localfile_messages_daemon {
    facility(daemon) and level(info .. emerg);
};
filter f_localfile_messages_syslog {
    facility(syslog) and level(info .. emerg);
};
filter f_localfile_messages_lpr {
    facility(lpr) and level(info .. emerg);
};
filter f_localfile_messages_uucp {
    facility(uucp) and level(info .. emerg);
};
filter f_localfile_messages_cron {
    facility(cron) and level(info .. emerg);
};
filter f_localfile_messages_ftp {
    facility(ftp) and level(info .. emerg);
};
filter f_localfile_messages_ntp {
    facility(ntp) and level(info .. emerg);
};
filter f_localfile_messages_security {
    facility(security) and level(info .. emerg);
};
filter f_localfile_messages_console {
    facility(console) and level(info .. emerg);
};
filter f_localfile_messages_solaris-cron {
    facility(solaris-cron) and level(info .. emerg);
};
filter f_localfile_messages {
    filter(f_localfile_messages_mail) or filter(f_localfile_messages_daemon) or filter(f_localfile_messages_syslog) or filter(f_localfile_messages_lpr) or filter(f_localfile_messages_uucp) or filter(f_localfile_messages_cron) or filter(f_localfile_messages_ftp) or filter(f_localfile_messages_ntp) or filter(f_localfile_messages_security) or filter(f_localfile_messages_console) or filter(f_localfile_messages_solaris-cron); };
log {
    source(s_src);
    filter(f_localfile_messages);
    destination(d_localfile_messages);
    flags(flow-control);
};
# end of localFile: messages

# localFile: security
destination d_localfile_security {
    program("/usr/local/bin/write_with_rotation.sh /var/log/security.log 10 10"
        flags(syslog-protocol)
        suppress(5)
        disk-buffer(
            mem-buf-size(2097152)
            disk-buf-size(4194304)
            reliable(yes)
            dir("/tmp")
        )
    );
};
filter f_localfile_security_auth {
    facility(auth) and level(info .. emerg);
};
filter f_localfile_security_authpriv {
    facility(authpriv) and level(info .. emerg);
};
filter f_localfile_security {
    filter(f_localfile_security_auth) or filter(f_localfile_security_authpriv); };
log {
    source(s_src);
    filter(f_localfile_security);
    destination(d_localfile_security);
    flags(flow-control);
};
# end of localFile: security

# localFile: user
destination d_localfile_user {
    program("/usr/local/bin/write_with_rotation.sh /var/log/user.log 10 10"
        flags(syslog-protocol)
        suppress(5)
        disk-buffer(
            mem-buf-size(2097152)
            disk-buf-size(4194304)
            reliable(yes)
            dir("/tmp")
        )
    );
};
filter f_localfile_user_user {
    facility(user) and level(info .. emerg);
};
filter f_localfile_user {
    filter(f_localfile_user_user); };
log {
    source(s_src);
    filter(f_localfile_user);
    destination(d_localfile_user);
    flags(flow-control);
};
# end of localFile: user
