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


(Numan Kizilirmak) #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:


(Makara) #2

@numan_KIZILIRMAK

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


(Numan Kizilirmak) #3

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


(Makara) #4

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


(Numan Kizilirmak) #5

@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


(Makara) #6

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


(Numan Kizilirmak) #7

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


(system) #8

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