Created
November 20, 2014 23:37
-
-
Save x684867/c7522f268b842e3665b7 to your computer and use it in GitHub Desktop.
Syslog centralization script
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
#centralizedSyslog | |
# | |
SET -e | |
apt-get update --fix-missing -y | |
apt-get install rsyslog-gnutls -y | |
echo '# /etc/rsyslog.conf | |
\$ModLoad imuxsock # provides support for local system logging | |
\$ModLoad imklog # provides kernel logging support | |
# Configure file capturing for SYSLOG so that we can collect data | |
# from non syslog file sources. | |
\$ModLoad imfile | |
\$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat | |
\$FileOwner root | |
\$FileGroup adm | |
\$FileCreateMode 0640 | |
\$DirCreateMode 0755 | |
\$Umask 0022 | |
\$WorkDirectory /var/spool/rsyslog | |
#TLS Encryption for syslog. | |
\$ActionSendStreamDriver gtls | |
\$ActionSendStreamDriverMode 1 | |
\$ActionSendStreamDriverAuthMode x509/name | |
# -------------------------------- | |
# Include config files identifying | |
# any external files to be loaded. | |
# -------------------------------- | |
\$IncludeConfig /etc/rsyslog.d/*.conf | |
*.* @syslog.mydomain.tld | |
'>/etc/rsyslog.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
#syslogNginx | |
# | |
echo ' | |
$InputFileName /var/log/nginx/access.log | |
$InputFileTag nginx.access.log: | |
$InputFileStateFile nginx-access-log | |
$InputFileSeverity info | |
$InputFileFacility local7 | |
$InputRunFileMonitor | |
# | |
$InputFileName /var/log/nginx/error.log | |
$InputFileTag nginx.error.log: | |
$InputFileStateFile nginx-error-log | |
$InputFileSeverity error | |
$InputFileFacility error | |
$InputRunFileMonitor | |
# | |
' > /etc/rsyslog.d/nginx.syslog.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment