logstash配置文件的格式是什么 [英] What is the format of logstash config file

查看:741
本文介绍了logstash配置文件的格式是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

logstash是否在配置文件中使用其自己的文件语法?是否有用于配置文件语法的解析器或验证器?

Does logstash use its own file syntax in config file? Is there any parser or validator for config file syntax?

对于任何不使用logstash但对文件格式有所了解的人,这里是一个示例语法:

For anyone that does not use logstash but have idea about file formats here is a sample syntax:

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

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

推荐答案

显然,自从发布答案以来,命令行参数已更新,并且--configtest--config参数不再有效.为了要求Logstash(至少v5)来验证配置文件:

Apparently command line arguments have been updated since the answers have been posted and --configtest and --config arguments are no longer valid. In order to ask Logstash (at least v5) to validate config file:

bin/logstash -t -f config.conf

带有扩展的参数,看起来像这样:

With expanded arguments it looks like this:

bin/logstash --config.test_and_exit --path.config config.conf

这篇关于logstash配置文件的格式是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆