logstash语法 结构

9 篇文章 0 订阅
5 篇文章 1 订阅

配置结构以及插件位置

输入插件:
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后面的参数 

1

bin/logstash -e 'input{stdin{}} output{stdout{}}'

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

1

bin/logstash -f mypipeline.conf

-t, --config.test_and_exit

1

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

-r, --config.reload.automatic

1

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

 

日志:  -l

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

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

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

输出DBUG: -vv

输出版本:-V, --version

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值