Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Yaml filebeat配置中的解组错误_Yaml_Logstash_Elastic Stack - Fatal编程技术网

Yaml filebeat配置中的解组错误

Yaml filebeat配置中的解组错误,yaml,logstash,elastic-stack,Yaml,Logstash,Elastic Stack,我已经为logstash配置了filebeat。但在启动filebeat时,我遇到以下错误: main.go:42: CRIT Config error: Error reading config file: YAML config parsing failed on /etc/filebeat/filebeat.yml: yaml: unmarshal errors: line 2: cannot unmarshal !!str `paths: ...` into []config.Pro

我已经为logstash配置了filebeat。但在启动filebeat时,我遇到以下错误:

main.go:42: CRIT Config error: Error reading config file: YAML config parsing failed on /etc/filebeat/filebeat.yml: yaml: unmarshal errors:
  line 2: cannot unmarshal !!str `paths:
...` into []config.ProspectorConfig. Exiting.
我在另一台服务器上用相同的配置配置了filebeat,它工作得很好,但我不明白为什么在这台服务器上会出现这种语法错误

以下是配置文件:

filebeat:
探矿者:|-
路径:
“/var/log/*.log”
注册表文件:/var/lib/filebeat/registry
配置目录:/etc/filebeat/conf.d
输出:
弹性搜索:
已启用:false
主持人:
- 52.35.55.85:9200
日志存储:
已启用:true
主持人:
- 52.32.18.237:5044
文件:
已启用:false
路径:/tmp/filebeat
文件名:filebeat
每千字节旋转一次:1000
_文件数:7

我对filebeat一无所知(甚至连Go都不知道),但以下错误消息:

无法解组!!str`路径:
…`进入[]config.ProspectorConfig。退出。
…向我建议,它将
路径
值扩展为一个序列(数组的YAML术语),而不是一个标量(字符串)。与此相反:

路径:
“/var/log/*.log”
…试试这个:

路径:
-“/var/log/*.log”
…或者,由于此处引用的是无关内容:

路径:
-/var/log/*.log

两台服务器的软件版本是否相同?谢谢您的建议。我仍然不明白为什么一台服务器上没有错误,而另一台服务器上却有错误,即使所有配置都完全相同。这个答案在为
filebeat\u output\u logstash\u主机定义主机时也适用;它们必须定义为数组。