This docker image is assumed that the Elasticseach server is localhost:9200.
Enter the following command in the repo directory.
$sudo docker build --force-rm=true -t logstashd .
$sudo docker run -d -p 5043:5043 --name logstashd logstashd
$mkdir ~/certs
Rename as logstash.key and logstash.crt, and put them into ~/certs directory.
$ifconfig eth0 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}'
$cp ./certs/openssl.cnf ~/certs/openssl.cnf
$vim ~/certs/openssl.cnf
Find the [ v3_ca ] section in this configuration file, and rewrite subjectAltName = IP: 127.0.0.1 as subjectAltName = IP: YOUR_IP_ADDRESS where YOUR_IP_ADDRESS is the IP you found or specified.
Generate certificate. (ex. IP is 127.0.0.1)
$openssl req -x509 -nodes -days 3650 -newkey rsa:2048 \
-keyout ~/certs/logstash.key -out ~/certs/logstash.crt \
-subj "/CN=127.0.0.1" \
-extensions v3_req -config ~/certs/openssl.cnf
$sudo docker run -d -v ~/certs:/certs -p 5043:5043 --name logstashd logstashd
$sudo docker exec logstashd service logstash status
$vim ./conf.d/lumberjack.conf
Find the elasticsearch block in this configuration file, and rewrite host => "localhost" as host => "YOUR_SERVER" where YOUR_SERVER is the domain or IP you specified. Please refer to the official documents for other configurations.
Build the image.
$vim ./conf.d/lumberjack.conf
Find the elasticsearch block in this configuration file, and rewrite host => "localhost" as host => "es".
Build the image.
Add option --link elasticsearchd:es in run command, such as
$sudo docker run -d -v ~/certs:/certs -p 5043:5043 --link elasticsearchd:es --name logstashd logstashd
docker pull minimum/logstashd:latest