Authored by chunhua.zhang

add configure

# This file is generated automatically, maintained by karl.zhou@yoho.cn
# Generated at 2017-11-10 14:05:54 +0800
# rsyslog v5 configuration file
# For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html
# If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html
#### MODULES ####
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$ModLoad imklog # provides kernel logging support (previously done by rklogd)
$ModLoad imfile # Load the imfile input module
#$ModLoad immark # provides --MARK-- message capability
#$MarkMessagePeriod 60 # mark messages appear every 1 Minute(s)
$ModLoad lmregexp
$IMUXSockRateLimitInterval 0
$SystemLogRateLimitInterval 0
# Provides UDP syslog reception
#$ModLoad imudp
#$UDPServerRun 514
$MaxMessageSize 10240k
# Provides TCP syslog reception
#$ModLoad imtcp
#$InputTCPServerRun 514
#### GLOBAL DIRECTIVES ####
# Use default timestamp format
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
# File syncing capability is disabled by default. This feature is usually not required,
# not useful and an extreme performance hit
#$ActionFileEnableSync on
#### RULES ####
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.* /dev/console
# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none;local5.none;local6.none /var/log/messages
# The authpriv file has restricted access.
authpriv.* /var/log/secure
# Log all the mail messages in one place.
mail.* -/var/log/maillog
# Log cron stuff
cron.* /var/log/cron
# Everybody gets emergency messages
*.emerg *
# Save news errors of level crit and higher in a special file.
uucp,news.crit /var/log/spooler
# Save boot messages also to boot.log
local7.* /var/log/boot.log
# ### begin forwarding rule ###
# The statement between the begin ... end define a SINGLE forwarding
# rule. They belong together, do NOT split them. If you create multiple
# forwarding rules, duplicate the whole block!
# Remote Logging (we use TCP for reliable delivery)
#
# An on-disk queue is created for this action. If the remote host is
# down, messages are spooled to disk and sent when it is up again.
#$WorkDirectory /var/lib/rsyslog # where to place spool files
#$ActionQueueFileName fwdRule1 # unique name prefix for spool files
#$ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible)
#$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
#$ActionQueueType LinkedList # run asynchronously
#$ActionResumeRetryCount -1 # infinite retries if host is down
# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
#*.* @@remote-host:514
# ### end of the forwarding rule ###
# ### begin forwarding rule ###
$template LongTagForwardFormat,"<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%"
$WorkDirectory /var/lib/rsyslog # where to place spool files
$ActionQueueFileName yoho_fwdRule # unique name prefix for spool files
$ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible)
$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
$ActionQueueType LinkedList # run asynchronously
$ActionResumeRetryCount 20 # infinite retries if host is down
$MainMsgQueueDiscardSeverity 8 # 禁止丢去消息
$MainMsgQueueTimeoutEnqueue 3000 # 超时3s
$MainMsgQueueDequeueBatchSize 500 # 优化带宽
local5.* @@rsyslog.yohoops.org:514;LongTagForwardFormat
# ### end of the forwarding rule ###
# Finally include all config files in /etc/rsyslog.d. This allows overrides
# of the default configuration above.
$WorkDirectory /var/lib/rsyslog
$IncludeConfig /etc/rsyslog.d/*.conf
# do not delete this line to guarantee final carriage return
... ...
# This file is generated automatically, maintained by karl.zhou@yoho.cn
# Generated at 2016-12-17 12:08:37 +0800
# send to rsyslog server for gateway
# /etc/rsyslog.d/*.conf
##########################################################################
# For gateway, total 35 files.
$InputFileName /Data/logs/gateway/alipay-err.log
$InputFileTag gateway,alipay-err
$InputFileSeverity info
$InputFileStateFile state_gateway_alipay-err
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/alipay.log
$InputFileTag gateway,alipay
$InputFileSeverity info
$InputFileStateFile state_gateway_alipay
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/alipayNew.log
$InputFileTag gateway,alipayNew
$InputFileSeverity info
$InputFileStateFile state_gateway_alipayNew
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/alipaywap-err.log
$InputFileTag gateway,alipaywap-err
$InputFileSeverity info
$InputFileStateFile state_gateway_alipaywap-err
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/alipaywap.log
$InputFileTag gateway,alipaywap
$InputFileSeverity info
$InputFileStateFile state_gateway_alipaywap
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/applepay-err.log
$InputFileTag gateway,applepay-err
$InputFileSeverity info
$InputFileStateFile state_gateway_applepay-err
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/applepay.log
$InputFileTag gateway,applepay
$InputFileSeverity info
$InputFileStateFile state_gateway_applepay
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/clearcache.log
$InputFileTag gateway,clearcache
$InputFileSeverity info
$InputFileStateFile state_gateway_clearcache
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/consumer-clearcache.log
$InputFileTag gateway,consumer-clearcache
$InputFileSeverity info
$InputFileStateFile state_gateway_consumer-clearcache
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/crfpay-err.log
$InputFileTag gateway,crfpay-err
$InputFileSeverity info
$InputFileStateFile state_gateway_crfpay-err
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/crfpay.log
$InputFileTag gateway,crfpay
$InputFileSeverity info
$InputFileStateFile state_gateway_crfpay
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/debug.log
$InputFileTag gateway,debug
$InputFileSeverity info
$InputFileStateFile state_gateway_debug
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/gc.log
$InputFileTag gateway,gc
$InputFileSeverity info
$InputFileStateFile state_gateway_gc
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/IP_LOGIN_MORE_LOG.log
$InputFileTag gateway,IP_LOGIN_MORE_LOG
$InputFileSeverity info
$InputFileStateFile state_gateway_IP_LOGIN_MORE_LOG
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/login_low_clientType_record.log
$InputFileTag gateway,login_low_clientType_record
$InputFileSeverity info
$InputFileStateFile state_gateway_login_low_clientType_record
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/memcache_montior_log.log
$InputFileTag gateway,memcache_montior_log
$InputFileSeverity info
$InputFileStateFile state_gateway_memcache_montior_log
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/paymentBD.log
$InputFileTag gateway,paymentBD
$InputFileSeverity info
$InputFileStateFile state_gateway_paymentBD
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/pcpay-err.log
$InputFileTag gateway,pcpay-err
$InputFileSeverity info
$InputFileStateFile state_gateway_pcpay-err
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/pcpay.log
$InputFileTag gateway,pcpay
$InputFileSeverity info
$InputFileStateFile state_gateway_pcpay
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/qqwallet-err.log
$InputFileTag gateway,qqwallet-err
$InputFileSeverity info
$InputFileStateFile state_gateway_qqwallet-err
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/qqwallet.log
$InputFileTag gateway,qqwallet
$InputFileSeverity info
$InputFileStateFile state_gateway_qqwallet
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/recommend.log
$InputFileTag gateway,recommend
$InputFileSeverity info
$InputFileStateFile state_gateway_recommend
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/search_invoke_log.log
$InputFileTag gateway,search_invoke_log
$InputFileSeverity info
$InputFileStateFile state_gateway_search_invoke_log
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/search_static_log.log
$InputFileTag gateway,search_static_log
$InputFileSeverity info
$InputFileStateFile state_gateway_search_static_log
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/static_log.log
$InputFileTag gateway,static_log
$InputFileSeverity info
$InputFileStateFile state_gateway_static_log
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/trace.log
$InputFileTag gateway,trace
$InputFileSeverity info
$InputFileStateFile state_gateway_trace
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/unionmpospay-err.log
$InputFileTag gateway,unionmpospay-err
$InputFileSeverity info
$InputFileStateFile state_gateway_unionmpospay-err
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/unionmpospay.log
$InputFileTag gateway,unionmpospay
$InputFileSeverity info
$InputFileStateFile state_gateway_unionmpospay
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/unionpay-err.log
$InputFileTag gateway,unionpay-err
$InputFileSeverity info
$InputFileStateFile state_gateway_unionpay-err
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/unionpay.log
$InputFileTag gateway,unionpay
$InputFileSeverity info
$InputFileStateFile state_gateway_unionpay
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/warn-log.log
$InputFileTag gateway,warn-log
$InputFileSeverity info
$InputFileStateFile state_gateway_warn-log
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/wechatpay-err.log
$InputFileTag gateway,wechatpay-err
$InputFileSeverity info
$InputFileStateFile state_gateway_wechatpay-err
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/wechatpay.log
$InputFileTag gateway,wechatpay
$InputFileSeverity info
$InputFileStateFile state_gateway_wechatpay
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/wechatwap-err.log
$InputFileTag gateway,wechatwap-err
$InputFileSeverity info
$InputFileStateFile state_gateway_wechatwap-err
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/wechatwap.log
$InputFileTag gateway,wechatwap
$InputFileSeverity info
$InputFileStateFile state_gateway_wechatwap
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
$InputFileName /Data/logs/gateway/gateway_access.log
$InputFileTag gateway,gateway_access
$InputFileSeverity info
$InputFileStateFile state_gateway_gateway_access
$InputFilePersistStateInterval 25
$InputFilePollInterval 1
$InputFileFacility local5
$InputRunFileMonitor
... ...
# This file is generated automatically, maintained by karl.zhou@yoho.cn
# Generated at 2017-11-10 14:02:45 +0800
# rsyslog v5 configuration file
# For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html
# If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html
#### MODULES ####
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$ModLoad imklog # provides kernel logging support (previously done by rklogd)
#$ModLoad immark # provides --MARK-- message capability
# Provides UDP syslog reception
#$ModLoad imudp
#$UDPServerRun 514
$MaxMessageSize 10240k
# Provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514
$InputTCPMaxSessions 2048
#### GLOBAL DIRECTIVES ####
# Use default timestamp format
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
# File syncing capability is disabled by default. This feature is usually not required,
# not useful and an extreme performance hit
#$ActionFileEnableSync on
################################################################################
$FileOwner yoholog
$FileGroup yoholog
$DirOwner yoholog
$DirGroup yoholog
$FileCreateMode 0644
$DirCreateMode 0755
$Umask 0022
# For karltest
# IMPORTANT - this template syntax is for rsyslog v5, latest is v8, there're different.
# http://www.rsyslog.com/doc/v5-stable/configuration/templates.html
$template KarltestFileFormat,"/Data/logs/karltest/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%-%$MONTH%-%$DAY%.log"
$template KarltestMsgFormat,"%timegenerated% %fromhost-ip% %syslogtag:F,44:2% %msg:::drop-last-lf%\n"
if $syslogtag startswith 'karltest' then ?KarltestFileFormat;KarltestMsgFormat
& ~ # 如果已经写入到log了,后面的不再处理
# template example
# For $ROLE$
# $template $ROLE$_FileFormat,"/Data/logs/erp/SHORTROLE/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
# if $syslogtag startswith '$ROLE$' then ?$ROLE$_FileFormat;CleanMsgFormat
# & ~
$template CleanMsgFormat,"%msg%\n"
################################################################################
###For pc-h5-node
# For yohobuy_shop_manage
$template yohobuy_shop_manage_FileFormat,"/Data/logs/node/yohobuy_shop_manage/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'yohobuy_shop_manage' then ?yohobuy_shop_manage_FileFormat;CleanMsgFormat
& ~
# For yohobuypc
$template yohobuypc_FileFormat,"/Data/logs/node/yohobuy-pc-node/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'yohobuypc' then ?yohobuypc_FileFormat;CleanMsgFormat
& ~
# For yohobuywap
$template yohobuywap_FileFormat,"/Data/logs/node/yohobuy-wap-node/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'yohobuywap' then ?yohobuywap_FileFormat;CleanMsgFormat
& ~
# For yoho-activity-platform
$template yoho-activity-platform_FileFormat,"/Data/logs/node/yoho-activity-platform/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'yoho-activity-platform' then ?yoho-activity-platform_FileFormat;CleanMsgFormat
& ~
################################################################################
###For pc-h5-nginx
# For nginx-pc-h5
$template nginx-pc-h5_FileFormat,"/Data/logs/php/nginx-pc-h5/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'nginx-pc-h5' then ?nginx-pc-h5_FileFormat;CleanMsgFormat
& ~
# For yohobuy
# For gateway
$template GatewayFileFormat,"/Data/logs/yohobuy/gateway/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'gateway' then ?GatewayFileFormat;CleanMsgFormat
& ~
# For cobar
$template cobarFileFormat,"/Data/logs/yohobuy/cobar/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'cobar' then ?cobarFileFormat;CleanMsgFormat
& ~
# For product
$template productFileFormat,"/Data/logs/yohobuy/product/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'product' then ?productFileFormat;CleanMsgFormat
& ~
# For sns
$template snsFileFormat,"/Data/logs/yohobuy/sns/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'sns' then ?snsFileFormat;CleanMsgFormat
& ~
# For message
$template messageFileFormat,"/Data/logs/yohobuy/message/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'message' then ?messageFileFormat;CleanMsgFormat
& ~
# For order
$template orderFileFormat,"/Data/logs/yohobuy/order/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'order' then ?orderFileFormat;CleanMsgFormat
& ~
# For promotion
$template promotionFileFormat,"/Data/logs/yohobuy/promotion/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'promotion' then ?promotionFileFormat;CleanMsgFormat
& ~
# For yoho-bigdata
$template yoho-bigdataFileFormat,"/Data/logs/yohobuy/yoho-bigdata/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'yoho-bigdata' then ?yoho-bigdataFileFormat;CleanMsgFormat
& ~
# For wechat-push
$template wechat-pushFileFormat,"/Data/logs/yohobuy/wechat-push/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'wechat-push' then ?wechat-pushFileFormat;CleanMsgFormat
& ~
# For activity
$template activityFileFormat,"/Data/logs/yohobuy/activity/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'activity' then ?activityFileFormat;CleanMsgFormat
& ~
# For users
$template usersFileFormat,"/Data/logs/yohobuy/users/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'users' then ?usersFileFormat;CleanMsgFormat
& ~
# For resources
$template resourcesFileFormat,"/Data/logs/yohobuy/resources/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'resources' then ?resourcesFileFormat;CleanMsgFormat
& ~
# For pc-h5
$template pc-h5FileFormat,"/Data/logs/pc-h5/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'pc-h5' then ?pc-h5FileFormat;CleanMsgFormat
& ~
# For uics
$template uicFileFormat,"/Data/logs/yohobuy/uic/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'uic' then ?uicFileFormat;CleanMsgFormat
& ~
# For union
$template unionFileFormat,"/Data/logs/yohobuy/union/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'union' then ?unionFileFormat;CleanMsgFormat
& ~
# For crm
$template crmFileFormat,"/Data/logs/yohobuy/crm/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'crm' then ?crmFileFormat;CleanMsgFormat
& ~
# For brower
$template browerFileFormat,"/Data/logs/yohobuy/brower/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'brower' then ?browerFileFormat;CleanMsgFormat
# For social
$template socialFileFormat,"/Data/logs/yohobuy/social/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'social' then ?socialFileFormat;CleanMsgFormat
& ~
# For platform
$template platformFileFormat,"/Data/logs/yohobuy/platform/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'platform' then ?platformFileFormat;CleanMsgFormat
& ~
# For yohobuy-shops
$template yohobuy-shopsFileFormat,"/Data/logs/yohobuy/shops/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'yohobuy-shops' then ?yohobuy-shopsFileFormat;CleanMsgFormat
& ~
# For yohobuy-portal-gateway
$template yohobuy-portal-gatewayFileFormat,"/Data/logs/yohobuy/portal-gateway/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'yohobuy-portal-gateway' then ?yohobuy-portal-gatewayFileFormat;CleanMsgFormat
& ~
# For nginx-java
$template nginxFileFormat,"/Data/logs/yohobuy/nginx-java/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'nginx' then ?nginxFileFormat;CleanMsgFormat
& ~
################################################################################
# For message center
# For msg-task
$template msgtaskFileFormat,"/Data/logs/yohobuy/message-center/task/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'msg-task' then ?msgtaskFileFormat;CleanMsgFormat
& ~
# For msg-push
$template msgpushFileFormat,"/Data/logs/yohobuy/message-center/push/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'msg-push' then ?msgpushFileFormat;CleanMsgFormat
& ~
# For msg-controller
$template msgcontrollerFileFormat,"/Data/logs/yohobuy/message-center/yoho-message-controller/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'msg-controller' then ?msgcontrollerFileFormat;CleanMsgFormat
& ~
# For msg-sender
$template msgsenderFileFormat,"/Data/logs/yohobuy/message-center/yoho-message-sender/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'msg-sender' then ?msgsenderFileFormat;CleanMsgFormat
& ~
# For msg-cms_push
$template msgcms_pushFileFormat,"/Data/logs/yohobuy/message-center/cms_push/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'msg-cms_push' then ?msgcms_pushFileFormat;CleanMsgFormat
& ~
################################################################################
# For ERP PREProles
# For prep-ams
$template prep-amsFileFormat,"/Data/logs/erpprep/ams/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'prep-ams' then ?prep-amsFileFormat;CleanMsgFormat
& ~
# For prep-bms
$template prep-bmsFileFormat,"/Data/logs/erpprep/bms/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'prep-bms' then ?prep-bmsFileFormat;CleanMsgFormat
& ~
# For prep-cs
$template prep-csFileFormat,"/Data/logs/erpprep/cs/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'prep-cs' then ?prep-csFileFormat;CleanMsgFormat
& ~
# For prep-erp-webservice
$template prep-erp-webserviceFileFormat,"/Data/logs/erpprep/erp-webservice/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'prep-erp-webservice' then ?prep-erp-webserviceFileFormat;CleanMsgFormat
& ~
# For prep-fms
$template prep-fmsFileFormat,"/Data/logs/erpprep/fms/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'prep-fms' then ?prep-fmsFileFormat;CleanMsgFormat
& ~
# For prep-gateWay
$template prep-gateWayFileFormat,"/Data/logs/erpprep/gateWay/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'prep-gateWay' then ?prep-gateWayFileFormat;CleanMsgFormat
& ~
# For prep-imclient
$template prep-imclientFileFormat,"/Data/logs/erpprep/imclient/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'prep-imclient' then ?prep-imclientFileFormat;CleanMsgFormat
& ~
# For prep-invoice
$template prep-invoiceFileFormat,"/Data/logs/erpprep/invoice/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'prep-invoice' then ?prep-invoiceFileFormat;CleanMsgFormat
& ~
# For prep-order
$template prep-orderFileFormat,"/Data/logs/erpprep/order/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'prep-order' then ?prep-orderFileFormat;CleanMsgFormat
& ~
# For prep-pop
$template prep-popFileFormat,"/Data/logs/erpprep/pop/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'prep-pop' then ?prep-popFileFormat;CleanMsgFormat
& ~
# For prep-stock
$template prep-stockFileFormat,"/Data/logs/erpprep/stock/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'prep-stock' then ?prep-stockFileFormat;CleanMsgFormat
& ~
# For prep-ticket
$template prep-ticketFileFormat,"/Data/logs/erpprep/ticket/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'prep-ticket' then ?prep-ticketFileFormat;CleanMsgFormat
& ~
# For prep-wms
$template prep-wmsFileFormat,"/Data/logs/erpprep/wms/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'prep-wms' then ?prep-wmsFileFormat;CleanMsgFormat
& ~
################################################################################
# For ERP roles
# For erp_gateway
$template erp_gateway_FileFormat,"/Data/logs/erp/gateway/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_gateway' then ?erp_gateway_FileFormat;CleanMsgFormat
& ~
# For erp_erp-monitor
$template erp_erp-monitor_FileFormat,"/Data/logs/erp/erp-monitor/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_erp-monitor' then ?erp_erp-monitor_FileFormat;CleanMsgFormat
& ~
# For erp_bms
$template erp_bms_FileFormat,"/Data/logs/erp/bms/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_bms' then ?erp_bms_FileFormat;CleanMsgFormat
& ~
# For erp_pop
$template erp_pop_FileFormat,"/Data/logs/erp/pop/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_pop' then ?erp_pop_FileFormat;CleanMsgFormat
& ~
# For erp_wms3
$template erp_wms3_FileFormat,"/Data/logs/erp/wms3/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_wms3' then ?erp_wms3_FileFormat;CleanMsgFormat
& ~
# For erp_wms
$template erp_wms_FileFormat,"/Data/logs/erp/wms/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_wms' then ?erp_wms_FileFormat;CleanMsgFormat
& ~
# For erp_stock
$template erp_stock_FileFormat,"/Data/logs/erp/stock/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_stock' then ?erp_stock_FileFormat;CleanMsgFormat
& ~
# For erp_order
$template erp_order_FileFormat,"/Data/logs/erp/order/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_order' then ?erp_order_FileFormat;CleanMsgFormat
& ~
# For erp_fms
$template erp_fms_FileFormat,"/Data/logs/erp/fms/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_fms' then ?erp_fms_FileFormat;CleanMsgFormat
& ~
# For erp_ams
$template erp_ams_FileFormat,"/Data/logs/erp/ams/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_ams' then ?erp_ams_FileFormat;CleanMsgFormat
& ~
# For erp_mqorder, 这个比较特别需要特殊处理
# 1.erp_mqorder-order-mq-aws
$template erp_mqorder-order-mq-aws_FileFormat,"/Data/logs/erp/mq_order/order-mq-aws/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_mqorder-order-mq-aws' then ?erp_mqorder-order-mq-aws_FileFormat;CleanMsgFormat
& ~
# 2.erp_mqorder-order-mq-qq
$template erp_mqorder-order-mq-qq_FileFormat,"/Data/logs/erp/mq_order/order-mq-qq/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_mqorder-order-mq-qq' then ?erp_mqorder-order-mq-qq_FileFormat;CleanMsgFormat
& ~
# 3.erp_mqorder-payment-mq-aws
$template erp_mqorder-payment-mq-aws_FileFormat,"/Data/logs/erp/mq_order/payment-mq-aws/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_mqorder-payment-mq-aws' then ?erp_mqorder-payment-mq-aws_FileFormat;CleanMsgFormat
& ~
# 4.erp_mqorder-payment-mq-qq
$template erp_mqorder-payment-mq-qq_FileFormat,"/Data/logs/erp/mq_order/payment-mq-qq/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_mqorder-payment-mq-qq' then ?erp_mqorder-payment-mq-qq_FileFormat;CleanMsgFormat
& ~
# 5.erp_mqorder-status-mq-aws
$template erp_mqorder-status-mq-aws_FileFormat,"/Data/logs/erp/mq_order/status-mq-aws/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_mqorder-status-mq-aws' then ?erp_mqorder-status-mq-aws_FileFormat;CleanMsgFormat
& ~
# 6.erp_mqorder-status-mq-qq
$template erp_mqorder-status-mq-qq_FileFormat,"/Data/logs/erp/mq_order/status-mq-qq/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_mqorder-status-mq-qq' then ?erp_mqorder-status-mq-qq_FileFormat;CleanMsgFormat
& ~
# For erp_mq-mq-aws
$template erp_mq-mq-aws_FileFormat,"/Data/logs/erp/mq/mq-aws/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_mq-mq-aws' then ?erp_mq-mq-aws_FileFormat;CleanMsgFormat
& ~
# For erp_mq
$template erp_mq-mq-web_FileFormat,"/Data/logs/erp/mq/mq-web/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_mq-mq-web' then ?erp_mq-mq-web_FileFormat;CleanMsgFormat
& ~
# For erp_job_order
$template erp_job_order_FileFormat,"/Data/logs/erp/job_order/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_job_order' then ?erp_job_order_FileFormat;CleanMsgFormat
& ~
# For erp_job
$template erp_job_FileFormat,"/Data/logs/erp/job/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_job' then ?erp_job_FileFormat;CleanMsgFormat
& ~
# For erp_invoice
$template erp_invoice_FileFormat,"/Data/logs/erp/invoice/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_invoice' then ?erp_invoice_FileFormat;CleanMsgFormat
& ~
# For erp_cs
$template erp_cs_FileFormat,"/Data/logs/erp/cs/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_cs' then ?erp_cs_FileFormat;CleanMsgFormat
& ~
# For erp_webservice
$template erp_webservice_FileFormat,"/Data/logs/erp/webservice/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_webservice' then ?erp_webservice_FileFormat;CleanMsgFormat
& ~
# For erp_imclient
$template erp_imclient_FileFormat,"/Data/logs/erp/imclient/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_imclient' then ?erp_imclient_FileFormat;CleanMsgFormat
& ~
# For erp_imserver
$template erp_imserver_FileFormat,"/Data/logs/erp/imserver/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_imserver' then ?erp_imserver_FileFormat;CleanMsgFormat
& ~
# For erp_ticket
$template erp_ticket_FileFormat,"/Data/logs/erp/ticket/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_ticket' then ?erp_ticket_FileFormat;CleanMsgFormat
& ~
# For erp_shop
$template erp_shop_FileFormat,"/Data/logs/erp/shop/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_shop' then ?erp_shop_FileFormat;CleanMsgFormat
& ~
# For erp_rms
$template erp_rms_FileFormat,"/Data/logs/erp/rms/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'erp_rms' then ?erp_rms_FileFormat;CleanMsgFormat
& ~
################################################################################
# For php projects
# For yohomars
$template yohomars_FileFormat,"/Data/logs/php/yohomars/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'yohomars' then ?yohomars_FileFormat;CleanMsgFormat
& ~
# For yohonow-apache
$template yohonow_apache_FileFormat,"/Data/logs/php/yohonow/apache/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'yohonow-apache' then ?yohonow_apache_FileFormat;CleanMsgFormat
& ~
# For yohonow-javaUic
$template yohonow_javaUic_FileFormat,"/Data/logs/php/yohonow/javaUic/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'yohonow-javaUic' then ?yohonow_javaUic_FileFormat;CleanMsgFormat
& ~
# For yohonow-nginx
$template yohonow_nginx_FileFormat,"/Data/logs/php/yohonow/nginx/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'yohonow-nginx' then ?yohonow_nginx_FileFormat;CleanMsgFormat
& ~
# For yohonow-sphinx
$template yohonow_sphinx_FileFormat,"/Data/logs/php/yohonow/sphinx/%fromhost-ip%/%syslogtag:F,44:2%-%$YEAR%%$MONTH%%$DAY%.log"
if $syslogtag startswith 'yohonow-sphinx' then ?yohonow_sphinx_FileFormat;CleanMsgFormat
& ~
################################################################################
#### RULES ####
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.* /dev/console
# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none;local5.none;local6.none /var/log/messages
# The authpriv file has restricted access.
authpriv.* /var/log/secure
# Log all the mail messages in one place.
mail.* -/var/log/maillog
# Log cron stuff
cron.* /var/log/cron
# Everybody gets emergency messages
*.emerg *
# Save news errors of level crit and higher in a special file.
uucp,news.crit /var/log/spooler
# Save boot messages also to boot.log
local7.* /var/log/boot.log
# ### begin forwarding rule ###
# The statement between the begin ... end define a SINGLE forwarding
# rule. They belong together, do NOT split them. If you create multiple
# forwarding rules, duplicate the whole block!
# Remote Logging (we use TCP for reliable delivery)
#
# An on-disk queue is created for this action. If the remote host is
# down, messages are spooled to disk and sent when it is up again.
#$WorkDirectory /var/lib/rsyslog # where to place spool files
#$ActionQueueFileName fwdRule1 # unique name prefix for spool files
#$ActionQueueMaxDiskSpace 5g # 5gb space limit (use as much as possible)
#$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
#$ActionQueueType LinkedList # run asynchronously
#$ActionResumeRetryCount -1 # infinite retries if host is down
# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
#*.* @@remote-host:514
# ### end of the forwarding rule ###
# Finally include all config files in /etc/rsyslog.d. This allows overrides
# of the default configuration above.
$IncludeConfig /etc/rsyslog.d/*.conf
... ...