Created
July 10, 2022 13:08
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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