首页 > 其他 > 详细

Logstash配置语法

时间:2017-12-20 23:40:24      阅读:272      评论:0      收藏:0      [点我收藏+]

配置结构以及插件位置

输入插件:
input{ … }
过滤插件:
filter{ … }
输出插件:
output{ … }

数据类型

- Array
users => [{id => 1,name => N1},{id => 2,name => N2}]

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

- Boolean
ssl_enable => true

- Bytes
my_bytes => "1113" # 1113 bytes
my_bytes => "10MiB" # 10485760 bytes

- Codec
codec => "json"

- Hash
match => {"field"=>"value1" "field"=>"value2"…}

- Number
port => 33

- Password
my_password => "password"

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

- Path
my_path=> "/tmp/logstash"

- String
name => "Hello World"

- Comments

this is a comment

条件判断

equality,etc: ==,!=,<,>,<=,>=
regexp: =~,!~
inclusion: in,not in
boolean: and ,or ,nand ,xor
unary: !()

命令行参数

执行: -e 执行-e后面的参数
bin/logstash -e ‘input{stdin{}} output{stdout{}}‘

文件: --config 或 -f 执行-f后面的conf文件

测试: --configtest 或 -t

日志: --log 或 -l

工作线程: --filterwokers 或 -w 只针对过滤器插件

插件: --pluginpath 或 -p 后面跟上插件存放的路径

输出调试日志:--verbose 或 -v 输入调试的日志

输出DBUG: -vv





Logstash配置语法

原文:http://www.cnblogs.com/blogjun/p/c33a55f69801cb5db38cbbade9a81db0.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!