Logstach配置文件详解

发布时间:2020-08-03 13:21:01 作者:genuinecx
来源:网络 阅读:1172

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

# This is a comment. You should use comments to describe
# parts of your configuration.
input {
  ...
}
filter {
  ...
}
output {
  ...
}


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

input {
  file {
    path => "/var/log/messages"
    type => "syslog"
  }
  file {
    path => "/var/log/apache/access.log"
    type => "apache"
  }
}


插件的值类型

数组

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


  布尔

ssl_enable => true


字符串

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


 哈希

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


  字节

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


 代码

 codec => "json"


 数值:浮点或整型

port => 33


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

 my_password => "password"


  路径型:字符串

my_path => "/tmp/logstash"


注释:使用#

推荐阅读:
  1. redis-配置文件详解
  2. nginx-配置文件详解

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

logstash elk og

上一篇:MPSOC开发实例——通过EMIO引出GPIO

下一篇:Typora编辑器

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》