代码之家  ›  专栏  ›  技术社区  ›  Raghuveer

带输出的FileBeat配置测试

  •  0
  • Raghuveer  · 技术社区  · 8 年前

    我正在尝试使用 filebeat test ouput -e -c filebeat.yml 我只看到命令列表的帮助消息。

    我实际上是想输出数据文件来验证。尽管我已经测试过了 filebeat test config -e -c filebeat.yml 好吧。

    2 回复  |  直到 8 年前
        1
  •  4
  •   Alexandre Juma    8 年前

    假设您使用的是filebeat 6.x(这些测试是在CentOS 7.5系统中使用filebeat6.5.0完成的)

    要测试filebeat配置(语法),可以执行以下操作:

    [root@localhost ~]# filebeat test config
    Config OK
    

    如果您刚刚下载了tarball,那么默认情况下,它使用untared filebeat目录中的filebeat.yml。如果您安装了RPM,它将使用/etc/filebeat/filebeat.yml。

    如果要定义其他配置文件,可以执行以下操作:

    [root@localhost ~]# filebeat test config -c /etc/filebeat/filebeat2.yml
    Config OK
    

    要测试输出块(即:如果您有到elasticsearch实例或卡夫卡代理的连接),可以执行以下操作:

    [root@localhost ~]# filebeat test output
    elasticsearch: http://localhost:9200...
      parse url... OK
      connection...
        parse host... OK
        dns lookup... OK
        addresses: ::1, 127.0.0.1
        dial up... ERROR dial tcp [::1]:9200: connect: connection refused
    

    在这种情况下,我的本地主机elasticsearch关闭,因此filebeat抛出一个错误,说它无法连接到我的输出块。

    与语法验证(测试配置)相同,您可以为输出连接测试提供不同的配置文件:

    [root@localhost ~]# filebeat test output -c /etc/filebeat/filebeat2.yml
    logstash: localhost:5044...
      connection...
        parse host... OK
        dns lookup... OK
        addresses: ::1, 127.0.0.1
        dial up... ERROR dial tcp [::1]:5044: connect: connection refused
    

    在这个备用配置文件中,我的输出块也无法连接到logstash实例。

        2
  •  0
  •   Krishna    7 年前

    -在命令“test”之前必须使用e-c标志

    filebeat -e -c filebeat.yml test ouput

     -c, --c argList Configuration file, relative to path.config (default beat.yml)
    
    推荐文章