ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console


(Alice) #1

Logstash version : 5.5.2
Elasticsearch version:5.5.2

When I use the command line(bin/logstash -f /etc/logstash/hello_es.conf), it throws a such error:

ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
Sending Logstash's logs to /home/wangyufeng/logstash-5.5.2/logs which is now configured via log4j2.properties
[2017-08-29T18:39:44,022][ERROR][logstash.agent ] Cannot create pipeline {:reason=>"Expected one of #, input, filter, output at line 1, column 1 (byte 1) after "}

Anyone can tell me how to resolve it?


(Imma) #2

It seems there's a problem with your logstash.conf file, hello_es.conf. Probably malformed. Can you include content in your post?


(Alice) #3

Thanks. the content of the hello_es.conf is:
input {
stdin {
type => "human"
}
}

output {
stdout {
codec => rubydebug
}

elasticsearch {
host => "10.62.179.32"
port => 9200
}
}
And it is located in/home/wangyfueng/logstash-5.5.2/cconfig/, when I run the command: bin/logstash -f /home/wangyfueng/logstash-5.5.2/cconfig/hello_es.conf, it throws this error:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
Sending Logstash's logs to /home/wangyufeng/logstash-5.5.2/logs which is now configured via log4j2.properties
[2017-08-30T14:10:35,377][ERROR][logstash.outputs.elasticsearch] Unknown setting 'host' for elasticsearch
[2017-08-30T14:10:35,380][ERROR][logstash.outputs.elasticsearch] Unknown setting 'port' for elasticsearch
[2017-08-30T14:10:35,386][ERROR][logstash.agent ] Cannot create pipeline {:reason=>"Something is wrong with your configuration."}


(Imma) #4

The correct sintax is, as you can see in https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-hosts, is:

elasticsearch {
  hosts => ["10.62.179.32:9200"]
}

(Alice) #5

Thanks, I have corrected the hello_es.conf:

input {
stdin {
type => "human"
}
}

output {
stdout {
codec => rubydebug
}

elasticsearch {
host => ["10.62.179.32: 9200"]
}
}
but it still has the error:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
Sending Logstash's logs to /home/wangyufeng/logstash-5.5.2/logs which is now configured via log4j2.properties
[2017-08-30T15:30:32,430][ERROR][logstash.outputs.elasticsearch] Unknown setting 'host' for elasticsearch
[2017-08-30T15:30:32,440][ERROR][logstash.agent ] Cannot create pipeline {:reason=>"Something is wrong with your configuration."}

Do I need to modify the path of logs in log4j2.properties? But I don't konw which line is the logs' path.


(Imma) #6

host is hosts. You're still missing the s.


(Alice) #7

Ok, thank you.


(system) #8

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