magnusbaeck / logstash-filter-verifier

Apache License 2.0
192 stars 27 forks source link

Support config file directory #49

Closed apollux closed 6 years ago

apollux commented 7 years ago

Currently when running logstash-filter-verifier like this: logstash-filter-verifier cases/ pipeline/ will result in the following error: Config file copy failed: read pipeline/: is a directory. Logstash supports loading configuration from a directory:

-f, --path.config CONFIG_PATH Load the logstash config from a specific file or directory. If a directory is given, all files in that directory will be concatenated in lexicographical order and then parsed as a single config file. You can also specify wildcards (globs) and any matched files will be loaded in the order described above.

It would be great if this would be supported by logstash-filter-verifier too!

matejzero commented 7 years ago

Currently, you can use logstash-filter-verifier cases/ pipeline/*.

It's not a solution, but a workaround:)

apollux commented 7 years ago

Simple and effective ;)

magnusbaeck commented 7 years ago

The suggested workaround should work fine in most if not all cases, but I'll keep the issue open since it's a fairly simple yet useful addition. I'll note, however, that future versions of Logstash will only read files matching *.conf if given a directory, so LFV should mimic this behavior for those Logstash versions.

NetAppRepoAdmin commented 6 years ago

Just to note that the help for the tool states

Logstash configuration file or a directory containing one or more configuration files.

If actual directory is not supported would be useful to update the help information and perhaps mention this workaround as the method for doing the same.

magnusbaeck commented 6 years ago

If actual directory is not supported would be useful to update the help information and perhaps mention this workaround as the method for doing the same.

Oops, I'd missed that. That clearly makes this a bug rather than an enhancement proposal. Fix coming up.