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

2019-02-24 01:29发布

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!

标签: logstash
3条回答
Animai°情兽
2楼-- · 2019-02-24 01:52

Try without quotes

C:\logstash-1.4.0\bin>logstash.bat agent -e input{stdin{}}output{stdout{}}
查看更多
Fickle 薄情
3楼-- · 2019-02-24 01:57

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.

查看更多
我欲成王,谁敢阻挡
4楼-- · 2019-02-24 02:06

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
查看更多
登录 后发表回答