Logstash expected one of #

依然范特西╮ 提交于 2019-12-07 12:23:29

问题


I'm currently trying to run Lostash with the following config file:

input { 
    stdin { } 
} 
output { 
    rabbitmq { 
        exchange => "test_exchange" 
        exchange_type => "fanout" 
        host => "172.17.x.x" 
    } 
}

I do however get an error:

logstash agent --configtest -f -config.conf

gives me:

Error: Expected one of #, } at line 1, column 105 (byte 105) after output { rabbitmq { exchange => test_exchange exchange_type => fanout host => 172.17

It seems that logstash has the problem when I put an IP-like address in the host field. What is wrong with my config?


回答1:


The whole problem was in the method you used when created the config.conf file.

You were using the following command:

echo "input {stdin{}} output{rabbitmq{exchange=>"test_exchange" exchange_type =>"fanout" host=>"172.17.x.x"}}"

Surrounding a string containing double quotes with double quotes isn't a good idea...

By using single quotes around the string, the problem is solved...




回答2:


The real problem is that logstash doesn't report access problems to the configuration file correctly. Here is the issue on github:

https://github.com/elastic/logstash/issues/2571

Simply check access permissions and you'll be set.



来源:https://stackoverflow.com/questions/29891630/logstash-expected-one-of

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!