zoukankan      html  css  js  c++  java
  • isequal 和startswith 使用

    如果要把不同服务器发送过来的日志保存到不同的文件, 可以这样操作:
    :fromhost-ip, isequal, “192.168.0.160″ /var/log/host160.log
    :FROMHOST-IP, isequal, “192.168.0.161″ /var/log/host161.log
    :FROMHOST-IP, startswith, “192.168.1.” /var/log/network1.log
    :FROMHOST-IP, startswith, “192.168.2.” /var/log/network2.log
    
    
    
    
    $EscapeControlCharactersOnReceive off      #关闭rsyslog默认转译ASCII<32的所有怪异字符,包括换行符等
    $template tocFormat,"%syslogtag%,%FROMHOST-IP%,%msg%
    "
    $template zjzc-flow01,"/data01/applog_backup/zjzc_log/zj-flow01-catalina.out.%$year%-%$month%-%$day%"       #定义TC:日志存放路径
    :syslogtag,isequal,"zjzc-flow01"  -?zjzc-flow01;tocFormat
    #if $syslogfacility-text == 'local5' and $msg startswith 'zjzc-flow01'  then   -?zjzc-flow01;tocFormat
    dr-mysql01:/data01/applog_backup/zjzc_log# 

  • 相关阅读:
    css3基础篇二
    css3基础篇一
    react基础篇六
    react基础篇五
    react基础篇四
    react基础篇三
    react基础篇二
    react基础篇一
    矩阵
    POJ 3071 Football
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13350403.html
Copyright © 2011-2022 走看看