We are using Elastic's Logstash Docker image (docker.elastic.co/logstash/logstash-oss:6.1.2
) as the base for our own Logstash Docker image build where we need to include a couple of logstash plugins for our own needs. However, when we look inside the base image under /opt/logstash/bin
we can see that there is a logstash-plugin.bat
file but there is no logstash-plugin.sh
file. Is this file missing or are we looking at the wrong command for installing images?
This is our Dockerfile which at the moment fails to include the given plugins into the new image when built:
FROM docker.elastic.co/logstash/logstash-oss:6.1.2
ENV LOGSTASH_HOME /opt/logstash
WORKDIR ${LOGSTASH_HOME}
RUN rm -f /usr/share/logstash/pipeline/logstash.conf \
bin/logstash-plugin install logstash-input-kafka \
bin/logstash-plugin install logstash-filter-prune
ADD pipeline/ /usr/share/logstash/pipeline/
ADD config/ /usr/share/logstash/config/
How should we install logstash plugins based on v6.1.2 of Elastic's Logstash Docker image?
Input Plugins. The Logstash-plugin utility is present in the bin folder of the Logstash installation directory.
Logstash is the “L” in the ELK Stack — the world's most popular log analysis platform and is responsible for aggregating data from different sources, processing it, and sending it down the pipeline, usually to be directly indexed in Elasticsearch.
The problem was in the Dockerfile itself which was missing &&
in between RUN commands which was therefore removing the logstash-plugin from the folder instead of executing it to install a plugin.
Correct Dockerfile:
FROM docker.elastic.co/logstash/logstash-oss:6.1.2
ENV LOGSTASH_HOME /opt/logstash
WORKDIR ${LOGSTASH_HOME}
RUN rm -f /usr/share/logstash/pipeline/logstash.conf && \
bin/logstash-plugin install logstash-input-kafka && \
bin/logstash-plugin install logstash-filter-prune
ADD pipeline/ /usr/share/logstash/pipeline/
ADD config/ /usr/share/logstash/config/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With