@version: 3.19
@include "scl.conf"

# 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("adm");
    perm(0640);
    stats_freq(0);
    bad_hostname("^gconfd$");
    ts-format("iso");
    time_zone("UTC");
    mark-freq(0);
    frac-digits(3);
};

# common block end


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

rewrite r_host { set("MYHOSTNAME", value("HOST")); };

# localFile: netconf-command
destination d_localfile_netconf-command {
    file("/var/log/netconf-command.log"
        flags(syslog-protocol)
        suppress(5)
        disk-buffer(
            mem-buf-size(2097152)
            disk-buf-size(4194304)
            reliable(yes)
            dir("/tmp")
        )
    );
};
filter f_localfile_netconf-command_local3 {
    facility(local3) and level(debug .. emerg);
};
filter f_localfile_netconf-command {
    filter(f_localfile_netconf-command_local3); };
log {
    source(s_src);
    filter(f_localfile_netconf-command);
    destination(d_localfile_netconf-command);
    flags(flow-control);
};
# end of localFile: netconf-command

destination d_mgmt_vrf_socket {
    unix-stream("/dev/uds_log"
        flags(syslog-protocol)
        disk-buffer(
            mem-buf-size(2097152)
            disk-buf-size(4194304)
            reliable(yes)
            dir("/tmp")
        )
    );
};
log {
    source(s_src);
    rewrite(r_host);
    destination(d_mgmt_vrf_socket);
};
