Skip to content

Instantly share code, notes, and snippets.

@Snawoot
Created July 10, 2022 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Snawoot/0d6452484106afc94d8736119245f120 to your computer and use it in GitHub Desktop.
Save Snawoot/0d6452484106afc94d8736119245f120 to your computer and use it in GitHub Desktop.
syslog-ng config for nice remote logging. place it into /etc/syslog-ng/conf.d/remote.conf
template remote {
template("${ISODATE} ${LEVEL} ${MSGHDR}${MESSAGE}\n");
};
destination d_sorted {
file(
"/var/log/remote/${PROGRAM}/${C_YEAR}_${C_MONTH}_${C_DAY}_${C_HOUR}.log"
create-dirs(yes)
template(remote)
time_zone("UTC")
);
};
source s_network {
network(transport(udp)
ip("::")
ip-protocol(6)
port(514)
log-msg-size(65536));
network(transport(tcp)
ip("::")
ip-protocol(6)
port(514)
max-connections(300)
log_iw_size(30000)
log-msg-size(65536));
syslog(transport(udp)
ip("::")
ip-protocol(6)
port(601)
log-msg-size(65536));
syslog(transport(tcp)
ip("::")
ip-protocol(6)
port(601)
max-connections(300)
log_iw_size(30000)
log-msg-size(65536));
};
log { source(s_network); destination(d_sorted); };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment