Docker image for Logstash
Logstash is a tool that can be used to collect, process and forward events and log images.
Collection: via configurable input plugins(raw socket, file tailing message bus clients). +
Processing: via filters which modify and annotate the event data. +
Output: Events are routed to output plugins (which can forward it to elasticsearch, localfile or message bus). +
The image is available directly from:
– PROD: vmapgmucrep01.appacp.tsi-af.de:5000/public/appagile-logstash:latest
– DEV: vmapgmucrep01.appacd.tsi-af.de:5000/public/appagile-logstash:latest
The configuration file for this Logstash image can be found under the link below. +
The user can change the configuration file to fit their needs. +
In the config file, the user can use environment virables to set elastic search output url and port as shown here:
hosts => [“$ELASTICSEARCH_URL:$ELASTICSEARCH_PORT”]
*NOTE* The current configuration file uses test-data saved inside the container as an input, performs some operation on the data and exports it to elastic search. +
First clone this git repository to your local machine.
Then export the two templates to your project.
$ oc create -f ose-artefacts/logstash-is-template.json
$ oc create -f ose-artefacts/logstash-template.json
=== Image Stream
Use the image stream template to create an image stream which will be used by the builder in the next step.
# oc process appagile-logstash-is-template -v DOCKER_IMAGE_REPOSITORY=
Check if imagestream has been created successfully.
$ oc get is appagile-logstash -o yaml
=== Deploy and Build Logstash
Process the template:
$ oc process appagile-logstash-template -v SOURCE_REPOSITORY_URL=https://github.com/rasp15/logstash_conf.git,IMAGE_STREAM_NAMESPACE=openshift,IMAGE_STREAM_NAME=appagile-logstash:latest,ELASTICSEARCH_URL=http://elasticsearch,ELASTICSEARCH_PORT=9200 | oc create -f –
– The repository at the `SOURCE_REPOSITORY_URL` should provide a `logstash.conf` config file at its root. If the environment variables `$ELASTICSEARCH_URL` and `$ELASTICSEARCH_PORT` are used within this file, they will be substituted with the respective values on container startup.
If the build did not start automatically, it can be manually started using the following command:
oc start-build telegraf
When the build is finished, it will automatically deploy start the container. +
Depending on the setting in the configuration file, Logstash will start collecting, processing and sending events and log messages. +