Error when using separate config files


(Dreadlocked) #1

Hi, I'm using the following command line to execute logstash with multiple config files:

$ /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/{1_inputs.conf,2_filters.conf,3_outputs.conf} --path.settings /etc/logstash

I've tried too

$ /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/*.conf --path.settings /etc/logstash

And always getting the following error:

ERROR: Unknown command '/etc/logstash/conf.d/2_filters.conf'

The config files content is:

  • input.conf

input {
....
}

  • filters.conf

filter{
....
}

  • outputs.conf

output {
...
}

What's happening here? (I'm using Logstash 5.3.0)


(Magnus B├Ąck) #2

Your command is expanded by the shell like this:

/usr/share/logstash/bin/logstash -f A B C --path.settings /etc/logstash

Since files B and C aren't preceded by -f Logstash is rightfully complaining.

Instead, put all files in a directory and pass that directory via -f.


(system) #3

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