logstash插件参数类型

来源:互联网 发布:js 去掉离开页面提示 编辑:程序博客网 时间:2024/04/19 20:38

logstash插件支持的参数类型有:

数组,如下所示:

users => [ {id => 1, name => bob}, {id => 2, name => jane} ]


列表,如下所示:

  path => [ "/var/log/messages", "/var/log/*.log" ]
  uris => [ "http://elastic.co", "http://example.net" ]


布尔型:可以为false或者true


Bytes,一个代表有效字节的单位,如下:

  my_bytes => "1113"   # 1113 bytes
  my_bytes => "10MiB"  # 10485760 bytes
  my_bytes => "100kib" # 102400 bytes
  my_bytes => "180 mb" # 180000000 bytes


哈希,如下:

match => {
  "field1" => "value1"
  "field2" => "value2"
  ...
}


Number,可以为float型或者int型,如下所示:

port => 33


Password,不打印的String类型,如下所示:

password => "password"


Path,一个有效系统路径的String,如下所示:

my_path => "/tmp/logstash"


String,如下所示:


URI,一个完整的url路径,如下所示:

my_uri => "http://foo:bar@example.net"


Codec,logstash codec的名字,被转换内容以相应codec插件来展示,如下所示:

 codec => "json"


参考:https://www.elastic.co/guide/en/logstash/current/configuration-file-structure.html#list