Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

--path.settings doesn't appear to be respected #23

Closed
mpalmer opened this issue Mar 26, 2017 · 3 comments
Closed

--path.settings doesn't appear to be respected #23

mpalmer opened this issue Mar 26, 2017 · 3 comments

Comments

@mpalmer
Copy link

mpalmer commented Mar 26, 2017

$ docker run -v /srv/docker/logstash:/logstash --rm docker.elastic.co/logstash/logstash:5.2.2 logstash --path.settings /logstash/logstash.yml
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 /logstash/log4j2.properties. Using default config which logs to console
(etc etc etc)

The file I'm referencing exists, is readable by logstash, and so on:

$ docker run -v /srv/docker/logstash:/logstash --rm docker.elastic.co/logstash/logstash:5.2.2 cat /logstash/logstash.yml
pipeline:
  workers: 64
  batch:
    size: 250
path:
  config: '/logstash/logstash.conf'
  queue: '/logstash/queue'
  reload:
    automatic: true
$ docker run -v /srv/docker/logstash:/logstash --rm docker.elastic.co/logstash/logstash:5.2.2 id
uid=1000(logstash) gid=1000(logstash) groups=1000(logstash)

If I instead set LS_SETTINGS_DIR appropriately, everything is happy:

$ docker run -v /srv/docker/logstash:/logstash -e LS_SETTINGS_DIR=/logstash --rm docker.elastic.co/logstash/logstash:5.2.2
Could not find log4j2 configuration at path /logstash/log4j2.properties. Using default config which logs to console
(etc etc etc)
@jarpy
Copy link
Contributor

jarpy commented Mar 29, 2017

It looks like the flag is failing because you are specifying the full path to logstash.yml, but the argument to --path.settings should be the containing directory.

eg:

docker run -v /srv/docker/logstash:/logstash --rm docker.elastic.co/logstash/logstash:5.2.2 logstash --path.settings /logstash

I personally think the error message is a little misleading, and implies that --path.settings is not set, when it's just set incorrectly.

From the docs:

--path.settings SETTINGS_DIR
  
  Set the directory containing the logstash.yml settings file as well as the log4j logging configuration. This 
  can also be set through the LS_SETTINGS_DIR environment variable. The default is the config directory 
  under Logstash home.

@mpalmer
Copy link
Author

mpalmer commented Mar 29, 2017

D'oh! Reading-the-docs-carefully fail. I definitely agree that a better error message would help, but apart from that this is entirely my bad (and the issue closed). Thanks for the gentle cluebat.

@jarpy
Copy link
Contributor

jarpy commented Mar 30, 2017

No worries. Thanks for reporting back.

@jarpy jarpy closed this as completed Mar 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants