zoukankan      html  css  js  c++  java
  • template(name="remote" type="string" string="%msg%")

    string
    
    [root@node01 log]# cat /etc/rsyslog.conf
    module(load="imfile")
    template(name="remote" type="string" string="%msg%")
    input (
     type="imfile"
     File="/root/log/a2.log"
     Tag="testlog02"
     PersistStateInterval="10"
     reopenOnTruncate="on"
     Severity="info"
     Facility="local5"
     ruleset="chat"
    )
    
    ruleset (name="chat"){
       action(type="omfwd" Target="192.168.137.3" Port="514" Protocol="tcp" template="remote")
    }
    
    
    template(name="remote" type="string" string="%msg%");
    
    
    这个非常类似于 legacy template statement. 它有一个强制性的参数字符串,
    
    持有要应用的模板字符串。
    
    一个 template string  是固定文本和替换变量的混合。
    
    那些变量是从消息或者其他动态内存中提取 当最终的字符串是被传递到一个插件。
    
    This is a sample for a string-based template: 有一个例子用于基于字符串的模板:
    
    template(name="tpl3" type="string"
             string="%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%
    "
            )
    
    
    文本在$之间是rsyslog 属性替换。简而言之,它包含使用的属性和选项用于格式化和进一步处理。
    
    这个非常列斯于属性对象在list模板里
    
    除了%符号外都是常量文本,在上面的例子中,我们有很多空格在属性值之间

  • 相关阅读:
    Python for i 循环
    Python 输入分数并评
    用户名和密码的输入
    cocos2d-x 3.0学习
    VS2008 ShotKey
    Cocos2d-x 3.0的安装方法
    VFC
    一、在WIN7 64位系统平台,VS2013环境下安装WTL90_4090_RC1(2014-04-01)
    http://www.vcf-online.org/
    Win7 64位 VS2012 安装 Qt5
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349639.html
Copyright © 2011-2022 走看看