rsyslog.conf 22 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524
# 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