"Fetched and Invalid Config" Error

Getting the official Logstash Docker container running on CentOS 7. Strange error after 15 or 30 seconds of launching the instance:

Sending Logstash's logs to /var/log/logstash which is now configured via log4j2.properties
21:32:34.666 [LogStash::Runner] ERROR logstash.agent - fetched an invalid config {:config=>"input {\n syslog {}\n tcp {\n port => 1514\n type => syslog\n }\n udp {\n port => 1514\n type => syslog\n }\n gelf {}\n}\noutput {\n redis {\n host => "logging-redis"\n data_type => "list"\n key => "logstash:redis"\n }\n}\n\n", :reason=>"Expected one of #, if, ", ', } at line 2, column 1 (byte 9) after input {\n"}
2017-02-09 21:32:34,722 Api Webserver ERROR No log4j2 configuration file found. Using default configuration: logging only errors to the console.

My logstash.conf just looks like this (as referenced in the error above):
input {
syslog {}
tcp {
port => 1514
type => syslog
udp {
port => 1514
type => syslog
gelf {}
output {
redis {
host => "logging-redis"
data_type => "list"
key => "logstash:redis"

I don't understand what's going on. I'm not even using "log4j2."

Never mind log4j2, that's noise. There's something on or near line 2 that Logstash doesn't like. Do you have an invisible garbage character right before "syslog{}" or thereabouts? You can inspect the file with e.g. hexdump -C.

See those sequences of c2 a0 everywhere? They're non-breaking spaces and they don't belong in your configuration file. Use regular spaces.


That worked, thanks @magnusbaeck !

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