ConfigurationError", :message=>"Expected one of #, input, filter, output at line 1, column 1

Hello, I want to get rabitmq messages from rabitmq to elasticsearch via logstash

my config is:

input {
rabbitmq {
host ⇒ "localhost"
queue => "LoggingToElastic"
exchange => "LogQueue"
durable => true
user => "guest"
password => "guest"
subscription_retry_interval_seconds => 10
}
}
output {
stdout { codec => rubydebug }
}

LoggingToElastic queue binded to LogQueue fanout excahge and when I want to start logstash
with this configuration

I get "LogStash::ConfigurationError", :message=>"Expected one of #, input, filter, output at line 1, column 1 (byte 1) after" error

detailed debug logs:

@numan_KIZILIRMAK

There seems to be different character after host instead of =>

@Makra I don"t think so becauese in rabbitmq input plugin documentation page character is =>

Yes it is => according to documentation. But the symbol that is there after the host parameter is not the same => as you might think. Just remove that character from the configuration and type again => and and make a config test. I tested your configuration and its OK.

Configuration OK

1 Like

@Makra yes you are right it was a different character but after I changed it to correct character => configtest give me the same error [FATAL][logstash.runner ] The given configuration is invalid. Reason: Expected one of #, input, filter, output at line 1, column 1 (byte 1) after

I am not sure if the config file can have JSON extension. Try changing the extension to .conf Also do you have some other configuration files in the config location ?

input {
        rabbitmq {
                        host => "localhost"
                        queue => "LoggingToElastic"
                        exchange => "LogQueue"
                        durable => true
                        user => "guest"
                        password => "guest"
                        subscription_retry_interval_seconds => 10
                }
}

output {
        stdout {
                        codec => rubydebug
        }
}

If i run the above config with following command it produces Configuration OK

$ /usr/share/logstash/bin/logstash --config.test_and_exit -f rabit.conf

just before you post I copied another sample file with .conf into my folder and I paste my configurations and it works now. Thanks @Makra

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.