Logstash error using logstash -f

i am using this tutorial


all things work fine , but when i created a new index and launch logstash by creating a conf file in /etc/logstash/conf.d the i restarted logstash, so i try to collect data unig "logstash -f" i have the following error:
usr/share/logstash/bin/logstash -f twitter_logstash.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
[WARN ] 2019-06-27 11:51:47.697 [LogStash::Runner] multilocal - Ignoring the 'pipelines.yml' file because modules or command line options are specified
[FATAL] 2019-06-27 11:51:47.722 [LogStash::Runner] runner - Logstash could not be started because there is already another instance using the configured data directory. If you wish to run multiple instances, you must change the "path.data" setting.
[ERROR] 2019-06-27 11:51:47.734 [LogStash::Runner] Logstash - java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

Problem is described in your log:

[FATAL] 2019-06-27 11:51:47.722 [LogStash::Runner] runner - Logstash could not be started because there is already another instance using the configured data directory. If you wish trun multiple instances, you must change the "path.data" setting.`

Logstash probably is already running on your server. Two instances of Logstash trying to access to path.data.

See: https://www.elastic.co/guide/en/logstash/current/logstash-settings-file.html

1 Like

so what shoud i do, yes i know that i have an other instance of losgtash started but what shoud i do to lanunch "logstash -f example.conf"

See: https://www.elastic.co/guide/en/logstash/current/running-logstash-command-line.html
--path.data parameter

1 Like

I'm sorry for the inconvenience, my commande will be "logstash -f example.conf --path.data "
can i choose any directory for the path data

No problem. Yes of course. E.g.:

--path.data /my/rw/directory/for/logstash/

Logstash has to have r/w access to this directory.

1 Like

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