Run logtsash on docker with custom pattern

Hi all,
how can I run a logstash container with a custom pattern folder?
the patterns folder is in the /pipeline folder together with pipeline config

As long as the directory with the pattern files is made available to the Docker container it's no different from using a custom pattern directory with a Logstash not running in a Docker container.

That does not help really. I have a pipeline folder wich contains:
filter.conf input.conf output.conf /patterns

In my filter.conf I have set patterns_dir => ["./patterns"], when I start the container with
docker run --rm -it -v ./pipeline/:/usr/share/logstash/pipeline/ --name logstash docker.elastic.co/logstash/logstash-oss:6.3.0 I get an error that pattern xyz (which is in the pattern dir) is not defined so the pattern dir is ignored

I always recommend using absolute paths (regardless of whether you're running Logstash in a Docker container). If that for some reason doesn't work you can try using the -w to set the working directory when starting the container. Of course, if Logstash itself changes its working directory it won't make a difference.

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