HUB
Sign inSign up

minimum/logstashd

By minimum

•Updated over 11 years ago

This image is Logstash service.

Image
0

1.5K

minimum/logstashd repository overview

⁠docker-logstashd

This docker image is assumed that the Elasticseach server is localhost:9200.

⁠Build

Enter the following command in the repo directory.

$sudo docker build --force-rm=true -t logstashd .

⁠Run

⁠Basic Run
$sudo docker run -d -p 5043:5043 --name logstashd logstashd
⁠Advanced Run
⁠Prepare a volume
$mkdir ~/certs
⁠Prepare SSL certificate
⁠Existing domain validated SSL certificate

Rename as logstash.key and logstash.crt, and put them into ~/certs directory.

⁠Find out IP address and generate self-signed certificate
  • Find out IP address if you do not know it.
$ifconfig eth0 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}'
  • Copy the OpenSSL configuration file.
$cp ./certs/openssl.cnf ~/certs/openssl.cnf
  • Open the OpenSSL configuration file to write
$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
⁠Run the docker image
$sudo docker run -d -v ~/certs:/certs -p 5043:5043 --name logstashd logstashd

⁠Check

$sudo docker exec logstashd service logstash status

⁠Note

⁠Specify Elasticsearch server
  • Open ./conf.d/lumberjack.conf in the repo directory to write
$vim ./conf.d/lumberjack.conf
⁠Use minimum-hsu/docker-elasticsearchd⁠
  • Open ./conf.d/lumberjack.conf in the repo directory to write
$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
Tag summary
Recent tags
Content type
Image
Digest
sha256:1b60297ef…
Size
531.4 MB
Last updated
over 11 years ago
docker pull minimum/logstashd:latest