Support Questions

Find answers, ask questions, and share your expertise

Logstash java.lang.IllegalStateException ?

avatar
Explorer

0favorite

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 => "http://localhost:9200" index => "fbpost" document_type => "post" timeout => 30 workers => 1 } }

and I am getting the result of execution below:

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=>#<ArgumentError: Path "/usr/share/logstash/data" must be a writable directory. It is not writable.>, :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:in `each'", "/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 `<main>'"]} [ERROR] 2018-07-05 12:47:56.554 [main] Logstash - java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

Can anyone help me?

1 REPLY 1

avatar
Super Guru
@Aymen Rahal

Quite a few errors in the output above. Seems the important one is:

Path "/usr/share/logstash/data" must be a writable directory. It is not writable.

After setting the permissions of /usr/share/logstash/data your command line should work.
However, I would suggest to run Logstash as its proper installed service, with configuration files in /etc/logstash.