无法启动filebeat.error缺少fileld

时间:2018-04-10 07:44:45

标签: logstash elastic-stack filebeat

下面是我的filebeat.yml文件,我无法启动服务获取错误

filebeat.prospectors:
- input_type: log
** paths:**
** - /opt/apache-tomcat-7.0.82/logs/*.log**

document_type: apache-access
fields_under_root: true

output.logstash:
** hosts: '${host}'**

主机是环境变量我输出主机=" 10.2.3.1:5044"

Apr 10 06:59:35 node1 filebeat[401]: Exiting: error initializing publisher: missing field accessing 'output.logstash.hosts' (source:'/etc/filebeat/filebeat.yml')
Apr 10 06:59:35 node1 systemd[1]: filebeat.service: main process exited, code=exited, status=1/FAILURE
Apr 10 06:59:35 node1 systemd[1]: Unit filebeat.service entered failed state.
Apr 10 06:59:35 node1 systemd[1]: filebeat.service failed.
Apr 10 06:59:35 node1 systemd[1]: filebeat.service holdoff time over, scheduling restart.
Apr 10 06:59:35 node1 systemd[1]: start request repeated too quickly for filebeat.service
Apr 10 06:59:35 node1 systemd[1]: Failed to start filebeat.
Apr 10 06:59:35 node1 systemd[1]: Unit filebeat.service entered failed state.
Apr 10 06:59:35 node1 systemd[1]: filebeat.service failed.``

2 个答案:

答案 0 :(得分:1)

我找到了解决方案,问题是Systemd没有传递环境变量。我开始将filebeat作为./filebeat -e -c filebeat.yml为我工作

答案 1 :(得分:0)

通过查看此信息,我发现您的配置存在多种语法差异。即使对于主机,页面底部也有一些示例。

https://www.elastic.co/guide/en/beats/filebeat/1.2/using-environ-vars.html

希望它有所帮助。