# Errors when running logstash

**URL:** <https://discuss.elastic.co/t/errors-when-running-logstash/126670>\
**Category:** Logstash\
**Created:** [April 4, 2018, 5:10am UTC](https://discuss.elastic.co/t/errors-when-running-logstash/126670 "2018-04-04T05:10:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chips](https://avatars.discourse-cdn.com/v4/letter/c/3ab097/32.png) [@Chips](https://discuss.elastic.co/u/Chips)\
**Post date:** [April 4, 2018, 5:10am UTC](https://discuss.elastic.co/t/errors-when-running-logstash/126670/1 "2018-04-04T05:10:27Z")

</div>

When I run the command `bin/logstash -f 01-wazuh.conf` two errors pop up and one warning. Although the file is on the specified path, oh well, the most important thing is how to fix the two lower errors?

```
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
[INFO] 2018-04-04 10:03:11.425 [main] scaffold - Initializing module {:module_name=>"netflow", :directory=>"/usr/share/logstash/modules/netflow/configuration"}
[INFO] 2018-04-04 10:03:12.222 [main] scaffold - Initializing module {:module_name=>"fb_apache", :directory=>"/usr/share/logstash/modules/fb_apache/configuration"}
[FATAL] 2018-04-04 10:03:12.339 [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:264: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:219: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:67:in `<main>'"]}
[ERROR] 2018-04-04 10:03:12.383 [main] Logstash - java.lang.IllegalStateException: org.jruby.exceptions.RaiseException: (SystemExit) exit

```

Here is the config logstash:

```
input {
  file {
    type => "rails logs"
    path => "/home/users/apps/demo/log/logstash_development.log"
    codec => json {
      charset => "UTF-8"
    }
  }
}

output {
  # Print each event to stdout.
  stdout {
    codec => rubydebug
  }

  elasticsearch {
    # Setting 'embedded' will run a real elasticsearch server inside logstash.
    # This option below saves you from having to run a separate process just
    # for ElasticSearch, so you can get started quicker!
    index => "wazuh-alerts-3.x-%{+YYYY.MM.dd}"
    document_type => "wazuh"

  }
}
```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 4, 2018, 5:58am UTC](https://discuss.elastic.co/t/errors-when-running-logstash/126670/2 "2018-04-04T05:58:42Z")

</div>

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

Either run Logstash as a user with write access to the directory or change the data directory path using the available settings in logstash.yml or the command-line option.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 2, 2018, 6:12am UTC](https://discuss.elastic.co/t/errors-when-running-logstash/126670/3 "2018-05-02T06:12:25Z")

</div>

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