Setting up LogStash as the logs parser and forwarder

We did E from the ELK stack. Now let's move to L. LogStash requires a configuration file. We'll use one that is already available inside the vfarcic/cloud-provisioning (https://github.com/vfarcic/cloud-provisioning) repository. We’ll create a new directory, copy the conf/logstash.conf (https://github.com/vfarcic/cloud-provisioning/blob/master/conf/logstash.conf) configuration, and use it inside the logstash service:

mkdir -p docker/logstashcp conf/logstash.conf \    docker/logstash/logstash.confcat docker/logstash/logstash.conf

The content of the logstash.conf file is as follows:

input {  syslog { port => 51415 }}output {  elasticsearch {    hosts => ["elasticsearch:9200"]  } # Remove in production ...

Get The DevOps 2.1 Toolkit: Docker Swarm now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.