zoukankan      html  css  js  c++  java
  • rsyslog 日志服务器端配置

    $EscapeControlCharactersOnReceive off      #关闭rsyslog默认转译ASCII<32的所有怪异字符,包括换行符等
    $template tocFormat,"%msg%
    "
    #$template tocFormat,"%syslogtag%,%msg%
    "
    $template zjzc-flow01,"/data01/applog_backup/zjzc_log/zj-flow01-catalina.out.%$year%-%$month%-%$day%"       #定义TC:日志存放路径
    $template zjzc-flow02,"/data01/applog_backup/zjzc_log/zj-flow02-catalina.out.%$year%-%$month%-%$day%"       #定义TC:日志存放路径
    $template zjzc-api01,"/data01/applog_backup/zjzc_log/zj-api01-catalina.out.%$year%-%$month%-%$day%"       #定义TC:日志存放路径
    $template zjzc-api02,"/data01/applog_backup/zjzc_log/zj-api02-catalina.out.%$year%-%$month%-%$day%"       #定义TC:日志存放路径
    $template zjzc-pay01,"/data01/applog_backup/zjzc_log/zj-pay01-catalina.out.%$year%-%$month%-%$day%"       #定义TC:日志存放路径
    $template zjzc-pay02,"/data01/applog_backup/zjzc_log/zj-pay02-catalina.out.%$year%-%$month%-%$day%"       #定义TC:日志存放路径
    ########################温金
    $template wj-flow01,"/data01/applog_backup/winfae_log/wj-flow01-catalina.out.%$year%-%$month%-%$day%"       #定义TC:日志存放路径
    $template wj-flow02,"/data01/applog_backup/winfae_log/wj-flow02-catalina.out.%$year%-%$month%-%$day%"       #定义TC:日志存放路径
    $template wj-api01,"/data01/applog_backup/winfae_log/wj-api01-catalina.out.%$year%-%$month%-%$day%"       #定义TC:日志存放路径
    $template wj-api02,"/data01/applog_backup/winfae_log/wj-api02-catalina.out.%$year%-%$month%-%$day%"       #定义TC:日志存放路径
    $template wj-pay01,"/data01/applog_backup/winfae_log/wj-pay01-catalina.out.%$year%-%$month%-%$day%"       #定义TC:日志存放路径
    $template wj-pay02,"/data01/applog_backup/winfae_log/wj-pay02-catalina.out.%$year%-%$month%-%$day%"       #定义TC:日志存放路径
    $template wj-proxy01,"/data01/applog_backup/winfae_log/wj-proxy01-catalina.out.%$year%-%$month%-%$day%"       #定义TC:日志存放路径
    :syslogtag,isequal,"wj-flow01"  -?wj-flow01;tocFormat
    :syslogtag,isequal,"wj-flow02"  -?wj-flow02;tocFormat
    :syslogtag,isequal,"wj-api01"  -?wj-api01;tocFormat
    :syslogtag,isequal,"wj-api02"  -?wj-api02;tocFormat
    :syslogtag,isequal,"wj-pay01"  -?wj-pay01;tocFormat
    :syslogtag,isequal,"wj-pay02"  -?wj-pay02;tocFormat
    :syslogtag,isequal,"wj-proxy01"  -?wj-proxy01;tocFormat
    
    
    ######################中均
    :syslogtag,isequal,"zjzc-flow01"  -?zjzc-flow01;tocFormat
    :syslogtag,isequal,"zjzc-flow02"  -?zjzc-flow02;tocFormat
    :syslogtag,isequal,"zjzc-api01"  -?zjzc-api01;tocFormat
    :syslogtag,isequal,"zjzc-api02"  -?zjzc-api02;tocFormat
    :syslogtag,isequal,"zjzc-pay01"  -?zjzc-pay01;tocFormat
    :syslogtag,isequal,"zjzc-pay02"  -?zjzc-pay02;tocFormat
    #if $syslogfacility-text == 'local5' and $msg startswith 'zjzc-flow01'  then   -?zjzc-flow01;tocFormat
    
    
    rsyslog 这里不需要配置 #$template tocFormat,"%syslogtag%,%msg%
    "
    
    就可以按照 :syslogtag,isequal,"zjzc-flow01" 进行匹配

  • 相关阅读:
    PAT(A) 1095. Cars on Campus (30)
    PAT(A) 1080. Graduate Admission (30)
    PAT(A) 1083. List Grades (25)
    Linux 使用create_ap开热点后无法连接wifi问题的解决
    汽车加油行驶问题(最短路)
    孤岛营救问题(最短路 状态压缩)  网络流24题
    软件补丁问题(状态压缩 最短路)
    餐巾计划问题(费用流)
    分配问题(二部图的最佳匹配 KM) 线性规划与网络流24题
    数字梯形问题(费用流)
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350397.html
Copyright © 2011-2022 走看看