template(name="remote" type="string" string="%msg%")
2017-07-24 14:25
344 查看
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%\n" ) 文本在$之间是rsyslog 属性替换。简而言之,它包含使用的属性和选项用于格式化和进一步处理。 这个非常列斯于属性对象在list模板里 除了%符号外都是常量文本,在上面的例子中,我们有很多空格在属性值之间
相关文章推荐
- C++ template typename to string <==> typeid(T).name()
- javax.el.PropertyNotFoundExceptionProperty "name" not found on type java.lang.String
- Jackson怎样转换这样的字符串? String jsonStr = "{dataType:'Custom',regexp:'t\\d+',msg:'输入不正确'}";
- hibernate的两个特殊注解@Transienth和@Enumerated(EnumType.STRING)和@Table(name="_teacher"),忽略,定义枚举,定义表名
- C++ templete: "class" vs "typename" in a template-parameter
- 用模板template<typename T>实现int double等类型转string
- 用模板template<typename T>实现int double等类型转string
- Jackson怎样转换这样的字符串? String jsonStr = "{dataType:'Custom',regexp:'t\\d+',msg:'输入不正确'}";
- 用模板template<typename T>实现int double等类型转string
- Jackson怎样转换这样的字符串? String jsonStr = "{dataType:'Custom',regexp:'t\\d+',msg:'输入不正确'}";
- 用模板template<typename T>实现int double等类型转string
- 用模板template<typename T>实现int double等类型转string
- Sub ShowSth(Optional msg As String = "Hi")
- Open quote is expected for attribute "{1}" associated with an element type "name".
- 模板声明中template <typename T>和template <class T>
- c++的template中的class和typename .
- typename "dependent scope"
- meta name的含义:<META http-equiv=Content-Type content="text/html; charset=gb2312">
- PHP $_SERVER["SCRIPT_NAME"]、$_SERVER["PHP_SELF"]、$_SERVER["QUERY_STRING"]、$_SERVER["REQUEST_URI"]
- PHP $_SERVER["QUERY_STRING"]、$_SERVER["REQUEST_URI"]、$_SERVER["SCRIPT_NAME"]和$_SERVER["PHP_SELF"]