2
votes

I am trying to execute this command: aymenstien@aymenstien-VPCEH2Q1E:/usr/share/logstash$ ./bin/logstash -f /home/aymenstien/Bureau/fb.conf

here is the config file:

input { file { path => "/home/aymenstien/Bureau/mydoc/*" start_position => beginning codec => json sincedb_path => "/home/aymenstien/Bureau/mydoc/postj1.sincedb" } } output { stdout { codec => rubydebug } elasticsearch { hosts => "localhost:9200"; index => "fbpost" document_type => "post" timeout => 30 workers => 1 } }

I am getting this error:

aymenstien@aymenstien-VPCEH2Q1E:/usr/share/logstash$ ./bin/logstash -f /home/aymenstien/Bureau/fb.conf WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults Could not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the console [FATAL] 2018-07-05 12:47:56.496 [main] runner - An unexpected error occurred! {:error=>#, :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/settings.rb:448:in validate'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:230:in validate_value'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:141:in block in validate_all'", "org/jruby/RubyHash.java:1343:ineach'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:140:in validate_all'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:279:in execute'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in run'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:238:in run'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/clamp-0.6.5/lib/clamp/command.rb:132:in run'", "/usr/share/logstash/lib/bootstrap/environment.rb:73:in '"]} [ERROR] 2018-07-05 12:47:56.554 [main] Logstash - java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

1
input { file { path => "/home/aymenstien/Bureau/mydoc/*" start_position => beginning codec => json sincedb_path => "/home/aymenstien/Bureau/mydoc/postj1.sincedb" } } output { stdout { codec => rubydebug } elasticsearch { hosts => "localhost:9200" index => "fbpost" document_type => "post" timeout => 30 workers => 1 } }Aymen Rahal
Please edit the post to make the config file legible--use indentation etc.Dave Newton

1 Answers

0
votes

Try using --path.settings /usr/share/logstash/config along with the config file.

The issue is that logstash is not able to find the settings directory(Config folder ) path.

Updated command: ./bin/logstash -f /home/aymenstien/Bureau/fb.conf --path.settings /usr/share/logstash/config