Logstash配置语法及相关命令


配置结构以及插件位置

输入插件:
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文件

bin/logstash -f mypipeline.conf

-t, --config.test_and_exit

bin/logstash -f first-pipeline.conf --config.test_and_exit

-r, --config.reload.automatic

bin/logstash -f first-pipeline.conf --config.reload.automatic

 

日志:  -l

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

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

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

输出DBUG: -vv

输出版本:-V, --version

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM