带输出的 FileBeat 配置测试
FileBeat configuration test with output
我正在尝试使用 filebeat test ouput -e -c filebeat.yml
测试我的配置我只看到带有命令列表的帮助消息。
我其实是想输出数据文件来验证。虽然我已经测试 filebeat test config -e -c filebeat.yml
没问题。
假设您正在使用 filebeat 6.x(这些测试是在 CentOS 7.5 系统中使用 filebeat 6.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 实例或 kafka 代理),您可以执行以下操作:
[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 实例。
-e -c 标志必须在命令前使用 "test"
filebeat -e -c filebeat.yml test ouput
-c, --c argList Configuration file, relative to path.config (default beat.yml)
我正在尝试使用 filebeat test ouput -e -c filebeat.yml
测试我的配置我只看到带有命令列表的帮助消息。
我其实是想输出数据文件来验证。虽然我已经测试 filebeat test config -e -c filebeat.yml
没问题。
假设您正在使用 filebeat 6.x(这些测试是在 CentOS 7.5 系统中使用 filebeat 6.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 实例或 kafka 代理),您可以执行以下操作:
[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 实例。
-e -c 标志必须在命令前使用 "test"
filebeat -e -c filebeat.yml test ouput
-c, --c argList Configuration file, relative to path.config (default beat.yml)