<pre name="code" class="html">下载下列软件
json-c-0.12-20140410.tar.gz---------------------https://github.com/json-c/json-c/archive/json-c-0.12-20140410.tar.gz
libestr-0.1.10.tar.gz-------------------http://libestr.adiscon.com/files/download/libestr-0.1.10.tar.gz
liblogging-1.0.5.tar.gz ----------------http://download.rsyslog.com/liblogging/liblogging-1.0.5.tar.gz
librdkafka-0.8.6.tar.gz -----------------------https://github.com/edenhill/librdkafka/archive/0.8.6.tar.gz
libuuid-1.0.3.tar.gz --------------------http://jaist.dl.sourceforge.net/project/libuuid/libuuid-1.0.3.tar.gz
zlib-1.2.8.tar.gz-------------------http://zlib.net/zlib-1.2.8.tar.gz
curl-7.44.0.tar.gz--------------http://curl.haxx.se/download/curl-7.44.0.tar.gz
rsyslog-8.15.0.tar.gz-------------------http://www.rsyslog.com/download/files/download/rsyslog/rsyslog-8.15.0.tar.gz
一:安装rsyslog
(1) json-c 安装
tar -xzvf json-c-0.12-20140410.tar.gz
cd json-c-0.12-20140410
./configure CC="gcc -m64" --prefix=/usr --libdir=/usr/lib64 && make && make install
(2) libestr安装
tar -xzvf libestr-0.1.10.tar.gz
cd libestr-0.1.10
./configure CC="gcc -m64" --prefix=/usr --libdir=/usr/lib64 && make && make install
(3) libuuid 安装
tar -xzvflibuuid-1.0.3.tar.gz
cdlibuuid-1.0.3
./configure CC="gcc -m64" --prefix=/usr --libdir=/usr/lib64 && make && make install
(4)zlib
安装
tar
-xzvf zlib-1.2.8.tar.gz
cdzlib-1.2.8
./configure --prefix=/usr --libdir=/usr/lib64 && make && make install
(5)liblogging
安装
tar
-xzvf liblogging-1.0.5.tar.gz
cdliblogging-1.0.5
./configure CC="gcc -m64" --prefix=/usr --libdir=/usr/lib64 --disable-journal && make && make install
(6)curl
安装
curl
./configure --prefix=/usr --libdir=/usr/lib64 && make && make install
(7) rsyslog 安装
tar -xzvf rsyslog-8.15.0.tar.gz
mv rsyslog-8.15.0 rsyslog
cd rsyslog
./configure CC="gcc -m64" PKG_CONFIG_PATH=/usr/lib64/pkgconfig LIBESTR_LIBS=/usr/lib64/libestr.a JSON_C_LIBS=/usr/lib64/libjson-c.a ZLIB_LIBS=/usr/lib64/libz.a LIBUUID_LIBS=/usr/lib64/libuuid.a CURL_LIBS=/usr/lib64/libcurl.a LIBLOGGING_STDLOG_LIBS=/usr/lib64/liblogging-stdlog.a LIBRDKAFKA_CFLAGS=/usr/include LIBRDKAFKA_LIBS=/usr/lib64/librdkafka.a --prefix=/usr --libdir=/usr/lib64 --enable-static --enable-debug --enable-elasticsearch --enable-elasticsearch-tests --enable-liblogging-stdlog --enable-imfile --enable-imptcp --enable-omstdout --enable-omruleset --enable-omuxsock --disable-libgcrypt
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$ModLoad imklog # provides kernel logging support (previously done by rklogd)
module(load="imfile" PollingInterval="5")
$ModLoad imtcp
$InputTCPServerRun 514
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$IncludeConfig /etc/rsyslog.d/*.conf
*.info;mail.none;authpriv.none;cron.none;local5.none /var/log/messages
authpriv.* /var/log/secure
mail.* -/var/log/maillog
cron.* /var/log/cron
uucp,news.crit /var/log/spooler
local7.* /var/log/boot.log
input(type="imfile"
File="/var/log/nginx/access.log"
Tag="zjzc-frontend01-access"
Severity="info"
Facility="local5")
input(type="imfile"
File="/var/log/nginx/error.log"
Tag="zjzc-frontend01-error"
Severity="info"
Facility="local5")
local5.* @@115.236.160.82:9514
/sbin/rsyslogd -f /etc/rsyslog.conf
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$ModLoad imklog # provides kernel logging support (previously done by rklogd)
module(load="imfile" PollingInterval="5")
$ModLoad imtcp
$InputTCPServerRun 514
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$IncludeConfig /etc/rsyslog.d/*.conf
*.info;mail.none;authpriv.none;cron.none;local5.none /var/log/messages
authpriv.* /var/log/secure
mail.* -/var/log/maillog
cron.* /var/log/cron
uucp,news.crit /var/log/spooler
local7.* /var/log/boot.log
input(type="imfile"
File="/data01/mysql/zjzc01-slow.log"
Tag="wj-mysql01"
Severity="info"
Facility="local5")
local5.* @@115.236.160.82:9514