我目前正在尝试使用以下配置文件运行Lostash:
input {
stdin { }
}
output {
rabbitmq {
exchange => "test_exchange"
exchange_type => "fanout"
host => "172.17.x.x"
}
}
但是我收到了错误:
logstash agent --configtest -f -config.conf
给了我:
错误:在输出{rabbitmq {exchange =>}之后,在第1行第105行(字节105)中预期#,}之一test_exchange exchange_type =>扇出主机=> 172.17
当我在主机字段中放置类似IP的地址时,似乎logstash存在问题。我的配置有什么问题?
答案 0 :(得分:4)
整个问题出现在创建config.conf文件时使用的方法中。
您使用以下命令:
echo "input {stdin{}} output{rabbitmq{exchange=>"test_exchange" exchange_type =>"fanout" host=>"172.17.x.x"}}"
包含带双引号的双引号的字符串不是一个好主意...
通过在字符串周围使用单引号,问题就解决了......
答案 1 :(得分:0)
真正的问题是logstash没有正确地向配置文件报告访问问题。这是github上的问题:
https://github.com/elastic/logstash/issues/2571
只需检查访问权限即可设置。