Expected one of #, input, filter, output in logstash

佐手、 提交于 2019-12-31 00:50:10

问题


I am trying to make logstash installation work by simply executing the command given in the documentation to echo back what ever typed.But that gives me the following error.

My command

 C:\logstash-1.4.0\bin>logstash.bat agent -e 'input{stdin{}}output{stdout{}}'

And the error

 Error: Expected one of #, input, filter, output at line 1, column 1 (byte 1) aft
 er
 You may be interested in the '--configtest' flag which you can
 use to validate logstash's configuration before you choose
 to restart a running system."

Please help.Thanks in advance!


回答1:


I am testing with logstash-1.4.0 on linux with this tutorial.

I think it is possible a bug on this version.

For example, I test this command on both linux and window. Everything is ok on linux. But it will occur your error at window!!

bin>logstash agent -e 'input{stdin{}}output{stdout{}}'

For my recommendation, you can write your configuration in a file. For example, save input{stdin{}}output{stdout{}} to a file call "stdin.conf". Then when you start logstash, don't use -e flag, instead use -f and specific your configuration file.

bin>logstash agent -f stdin.conf

Hope this can help you.




回答2:


Try without quotes

C:\logstash-1.4.0\bin>logstash.bat agent -e input{stdin{}}output{stdout{}}



回答3:


I get this error when I run -e with --debug. I have to remove -e. Example:

GEM_HOME="/opt/logstash/vendor/bundle/jruby/1.9/" /usr/lib/jvm/java-1.6.0/bin/java -server -Xms765M -Xmx2297M -Djava.io.tmpdir=/opt/logstash/forwarder/tmp/ -Xmx2297M -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Djava.awt.headless=true -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -jar /opt/logstash/forwarder/vendor/jar/jruby-complete-1.7.11.jar -I/opt/logstash/forwarder/lib /opt/logstash/forwarder/lib/logstash/runner.rb agent -f /opt/logstash/forwarder/etc/conf.d/ -l /opt/logstash/forwarder/log/logstash.log -w 1 --debug


来源:https://stackoverflow.com/questions/22629795/expected-one-of-input-filter-output-in-logstash

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