Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker compose Logstash - specify config file and install plugin?

Im trying to copy my Logstash config and install a plugin at the same time. Ive tried multiple methods thus far with no avail, Logstash exists with errors every time

this fails:

logstash:  
  image: logstash:latest
  command: logstash -f /etc/logstash/conf.d/logstash.conf 
  command: bash -c bin/logstash-plugin install logstash-filter-translate

this fails:

command: logstash -f /etc/logstash/conf.d/logstash.conf bash -c bin/logstash-plugin install logstash-filter-translate

this fails:

command: logstash -f /etc/logstash/conf.d/logstash.conf && bash -c bin/logstash-plugin install logstash-filter-translate

this also fails

command: bash -c logstash -f /etc/logstash/conf.d/logstash.conf && bin/logstash-plugin install logstash-filter-translate

Im having no luck here and I bet the answer is simple... can anyone point me in the right direction?

Thanks

like image 542
AlexW Avatar asked Mar 07 '23 10:03

AlexW


1 Answers

I use the image that I am having locally with the below config, then it's working fine. Hope it helps.

version: '3'
services:
  logstash:  
    image: docker.elastic.co/logstash/logstash:5.6.3
    command: bash -c "logstash -f /etc/logstash/conf.d/logstash.conf && bin/logstash-plugin install logstash-filter-translate"

Sample output

logstash_1  | [2017-12-06T15:27:29,120][WARN ][logstash.agent           ] stopping pipeline {:id=>".monitoring-logstash"}
logstash_1  | Validating logstash-filter-translate
logstash_1  | Installing logstash-filter-translate
like image 194
sayboras Avatar answered Mar 10 '23 18:03

sayboras