logstash cannot create pipeline reason= expected one of #

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


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
    You probably have some garbage character at the end of your file (or wherever offset 105 ends up). If I copy the config file snippet above into a new file Logstash is happy with it. Feeding your file to hexdump -Cshould make the mistake easy to spot. –  Magnus Bäck  Apr 27 '15 at 9:48
  • Nop, I still have the same problem, even after having recreated the file from scratch or used the -e option. –  Heschoon  Apr 27 '15 at 12:43
  • Okay, seems that it had something to do with the way I created the config.conf; I was using an echo "content" > config.conf, but the problem is that I surround a text containing double quotes with double quotes... Surrounding the contents by single quotes when creating the config.conf file did solve my problem. –  Heschoon  Apr 27 '15 at 13:34

2 Answers

up vote 2 down vote accepted

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...

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.


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值