logstash icon indicating copy to clipboard operation
logstash copied to clipboard

How I can check sintax logstash 5.0

Open simpleuser99 opened this issue 10 years ago • 6 comments

Hello/ In logstash 2.x I use the next command /usr/share/logstash/bin/logstash --configtest -f /etc/logstash/conf.d/*.conf to check config syntax. But in logstash 5.0 it doesn't work. And the next, if I create mistakes in logstash config and use initctl restart logstash I don't have stdout message about error.

How can I check config syntax in logstash 5.0?

simpleuser99 avatar Nov 03 '16 07:11 simpleuser99

logstash -f /etc/logstash/conf.d/ -t or logstash -f /etc/logstash/conf.d/ --config.test_and_exit

--configtest option no longer exist. Try "logstash -h" for more details

5.x onwards, it doesnt support log output in console. Please check below issue #6161

bimalm avatar Nov 04 '16 07:11 bimalm

This is now the config.test_and_exit setting. (see https://www.elastic.co/guide/en/logstash/current/logstash-settings-file.html)

You should be able to use this as a flag: --config.test_and_exit

jordansissel avatar Nov 10 '16 07:11 jordansissel

logstash -f /etc/logstash/conf.d/ -t

when i use this it throws error **bash: logstash: command not found**

viveksamaga avatar Jun 08 '17 11:06 viveksamaga

@viveksamaga make sure you are in the right path where the logstash file is. also your shell may not have the current directory as part of the path, so you may need to do ./logstash -f "/etc/logstash/conf.d/*" -t

jsvd avatar Jun 08 '17 11:06 jsvd

In ubuntu 16.10, if you have installed logstash using apt-get then use- $ /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/ --config.test_and_exit

Dwijad avatar Jun 09 '17 11:06 Dwijad

./logstash -t -f /path/to/config/file --path.settings=/etc/logstash/config.d

dhanunjayavarma avatar Nov 08 '17 06:11 dhanunjayavarma