Logstach配置文件详解

配置文件的基本格式,输入部分,过滤器部分和输出部分。

1
2
3
4
5
6
7
8
9
10
11
# This is a comment. You should use comments to describe
# parts of your configuration.
input {
   ...
}
filter {
   ...
}
output {
   ...
}


每个部分都可以配置一个或多个插件。下面展示的是输入部分,有两个file插件。

1
2
3
4
5
6
7
8
9
10
input {
   file  {
     path =>  "/var/log/messages"
     type  =>  "syslog"
   }
   file  {
     path =>  "/var/log/apache/access.log"
     type  =>  "apache"
   }
}


插件的值类型

数组

1
2
path => [  "/var/log/messages" "/var/log/*.log"  ]
path =>  "/data/mysql/mysql.log"


  布尔

1
ssl_enable =>  true


字符串

1
2
  name =>  "Hello world"
  name =>  'It\'s a beautiful day'


 哈希

1
2
3
4
5
match => {
   "field1"  =>  "value1"
   "field2"  =>  "value2"
   ...
}


  字节

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


 代码

1
  codec =>  "json"


 数值:浮点或整型

1
port => 33


密码型:不会记录到日志或打印出来

1
  my_password =>  "password"


  路径型:字符串

1
my_path =>  "/tmp/logstash"


注释:使用#





本文转自 genuinecx 51CTO博客,原文链接:http://blog.51cto.com/favccxx/1826747,如需转载请自行联系原作者
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值