Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logstash Docker Image - Missing logstash-plugin?

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?

like image 742
Going Bananas Avatar asked Jan 30 '18 14:01

Going Bananas


People also ask

Where are Logstash plugins installed?

Input Plugins. The Logstash-plugin utility is present in the bin folder of the Logstash installation directory.

What is Logstash plugin?

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.


1 Answers

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/
like image 178
Going Bananas Avatar answered Oct 17 '22 04:10

Going Bananas